832f1f7cb580a7e0447b953dbf865787bb6e304a angie Fri Sep 26 17:23:54 2014 -0700 HT Hiram for noticing chrom ideogram bug in Ebola -- the ideogram's left labelchanges depending on band name, and band names with different widths cause the label width to change, and that causes the coords of the image areas to change; but the javascript was neglecting to update the ideogram image map, thinking it would be the same for any view on the same chromosome. Now we always update it. Not terribly expensive to replace an image map with only chromosome band areas. diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 9478a9a..978e58a 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -3070,34 +3070,39 @@ // Need to reorder the rows based upon abbr dragReorder.sort($(imgTbl)); } }, updateChromImg: function (response) { // Parse out new chrom 'ideoGram' (if available) // e.g.: // Larry's regex voodoo: var a = /]+SRC[^>]+id='chrom'[^>]*)>/.exec(response); if (a && a[1]) { var b = /SRC\s*=\s*"([^")]+)"/.exec(a[1]); if (b && b[1]) { $('#chrom').attr('src', b[1]); - // ideoMap? Not needed if the chrom has not changed. - //a = /([\s\S]+)<\/MAP>/.exec(response); - //if (a && a[1]) - // $("map[name='idelMap']").html('src', a[1]); + // Even if we're on the same chrom, ideoMap may change because the label + // on the left changes width depending on band name, and that changes px scaling. + var ideoMapMatch = /[\s\S]+?<\/MAP>/.exec(response); + if (ideoMapMatch) { + var $oldMap = $("map[name='ideoMap']"); + var $container = $oldMap.parent(); + $oldMap.remove(); + $container.append(ideoMapMatch[0]); + } if (imageV2.backSupport) { // Reinit chrom dragging. if ($('area.cytoBand').length >= 1) { $('img#chrom').chromDrag(); } } } } }, requestImgUpdate: function (trackName,extraData,loadingId,newVisibility) { // extraData, loadingId and newVisibility are optional var data = "hgt.trackImgOnly=1&hgsid=" + getHgsid() + "&hgt.trackNameFilter=" + trackName; if (extraData && extraData !== "")