45c9532b9711e24298ca3900a6d4b45e4b51983c galt Tue Jan 27 14:43:53 2015 -0800 Fixes #7474 - mouseover now shows exon and intron numbers for linkedFeatures tracks. diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 8377efa..ed40dd0 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -1486,30 +1486,47 @@ if (!id || id.length === 0) { id = ''; var tr = $( this ).parents('tr.imgOrd'); if ( $(tr).length === 1 ) { var a = /tr_(.*)/.exec($(tr).attr('id')); // voodoo if (a && a[1]) { id = a[1]; } } } if (id.length > 0) { rightClick.currentMapItem = rightClick.makeMapItem(id); if (rightClick.currentMapItem) { rightClick.currentMapItem.href = this.href; rightClick.currentMapItem.title = this.title; + + // Handle linked features with separate clickmaps for each exon/intron + if ((this.title.indexOf('Exon ') === 0) || (this.title.indexOf('Intron ') === 0)) { + // if the title is Exon ... or Intron ... + // then search for the sibling with the same href + // that has the real title item label + var elem = this.parentNode.firstChild; + while (elem) { + if ((elem.href === this.href) + && !((elem.title.indexOf('Exon ') === 0) || (elem.title.indexOf('Intron ') === 0))) { + rightClick.currentMapItem.title = elem.title; + break; + } + elem = elem.nextSibling; + } + } + } } }, mapItemMouseOut: function () { imageV2.lastTrack = rightClick.currentMapItem; // Just a backup rightClick.currentMapItem = null; }, init: function () { // Make side buttons visible (must also be called when updating rows in the imgTbl). var btns = $("p.btn"); if (btns.length > 0) { dragReorder.zipButtons($('#imgTbl'));