4c7777010756e76c973ee248c9c8fa3738e7ea02 larrym Tue Aug 2 18:10:35 2011 -0700 fix bugs in allowDragAndZoomEverywhere diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index b714e1a..d239973 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -373,43 +373,36 @@ trackImg = $('#img_data_ruler'); if(trackImg == undefined || trackImg.length == 0) { // Revert to old imageV1 trackImg = $('#trackMap'); imgHeight = jQuery(trackImg).height(); } else { imageV2 = true; trackImgTbl = $('#imgTbl'); imgHeight = trackImg.height(); // XXXX Tim, I think we should get height from trackImgTbl, b/c it automatically adjusts as we add/delete items. imgHeight = trackImgTbl.height(); } var heights; if(allowDragAndZoomEverywhere) { heights = []; - var titleHeight; + var imgTop = trackImgTbl.offset().top; $('div.cntrLab').each(function (i) { - titleHeight = $(this).css('height'); - titleHeight = titleHeight.substring(0, titleHeight.length - 2) * 1; - return false; - }); - $('img.sideLab').each(function (i) { - var top = $(this).css('top'); - top = top.substring(0, top.length - 2); - top = top * -1; + var top = $(this).offset().top - imgTop; heights.push({ top: top, - bottom: top + titleHeight + bottom: top + $(this).height() }); }); } else { heights = hgTracks.rulerClickHeight; } imgAreaSelect = jQuery((trackImgTbl || trackImg).imgAreaSelect({ selectionColor: 'blue', outerColor: '', minHeight: imgHeight, maxHeight: imgHeight, onSelectStart: selectStart, onSelectChange: selectChange, onSelectEnd: selectEnd, autoHide: autoHideSetting, movable: false, clickClipHeight: heights})); } } function makeItemsEnd(img, selection) {