be4311c07e14feb728abc6425ee606ffaa611a58 markd Fri Jan 22 06:46:58 2021 -0800 merge with master diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index e02fe81..c72d7be 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -2728,61 +2728,64 @@ } } done = true; } } } if (done) { o = {}; var any = false; var title = rightClick.selectedMenuItem.title || "feature"; var maxLength = 60; if (title.length > maxLength) { title = title.substring(0, maxLength) + "..."; } + if ((isGene || isHgc || id === "wikiTrack") && href.indexOf("i=mergedItem") === -1) { // Add "Open details..." item var displayItemFunctions = false; if (rec) { if (rec.type.indexOf("wig") === 0 || rec.type.indexOf("bigWig") === 0 || id === "wikiTrack") { displayItemFunctions = false; } else if (rec.type.indexOf("expRatio") === 0) { displayItemFunctions = title !== "zoomInMore"; } else { displayItemFunctions = true; } // For barChart mouseovers, replace title (which may be a category // name+value) with item name if (rec.type.indexOf("barChart") === 0 || rec.type.indexOf("bigBarChart") === 0) { a = /i=([^&]+)/.exec(href); if (a && a[1]) { title = a[1]; } } } - if (isHgc && href.indexOf('g=gtexGene') !== -1) { - // For GTEx gene mouseovers, replace title (which may be a tissue name) with - // item (gene) name + + if (isHgc && ( href.indexOf('g=gtexGene')!== -1 || href.indexOf('g=unip') !== -1 )) { + // For GTEx gene and UniProt mouseovers, replace title (which may be a tissue name) with + // item (gene) name. Also need to unescape the urlencoded characters and the + sign. a = /i=([^&]+)/.exec(href); if (a && a[1]) { - title = a[1]; + title = decodeURIComponent(a[1].replace(/\+/g, " ")); } } + if (displayItemFunctions) { o[rightClick.makeImgTag("magnify.png") + " Zoom to " + title] = { onclick: function(menuItemClicked, menuObject) { rightClick.hit(menuItemClicked, menuObject, "selectWholeGene"); return true; } }; o[rightClick.makeImgTag("highlight.png") + " Highlight " + title] = { onclick: function(menuItemClicked, menuObject) { rightClick.hit(menuItemClicked, menuObject, "highlightItem"); return true; } }; if (rightClick.supportZoomCodon && rec.type.indexOf("genePred") !== -1) {