c32d6e08d19a0b8ad7ece12aab39d0ba0be7a9e1
chmalee
Mon Dec 1 16:26:27 2025 -0800
hgTracks tooltips use the data-tooltip attribute on the area element if present, falling back to the title attribute. Makes title attributes for (hopefully all) tracks with special tooltips put the tooltip string into the data-tooltip attribute instead of the title attribute, refs #35756
diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js
index 6497cd8565c..b88f5a5caa0 100644
--- src/hg/js/hgTracks.js
+++ src/hg/js/hgTracks.js
@@ -2759,30 +2759,34 @@
{ // Return img tag with explicit dimensions for img (dimensions are currently hardwired).
// This fixes the "weird shadow problem when first loading the right-click menu"
// seen in FireFox 3.X, which occurred b/c FF doesn't actually fetch the image until
// the menu is being shown.
return "
";
},
// CGIs now use HTML tags, e.g. "Transcript: ENST00000297261.7
Strand:"
mouseOverToLabel: function(title)
{
if (title.search(/Transcript: ?<[/]b>/) !== -1) {
title = title.split("
")[0].split("")[1];
}
+ // for older UCSC genes tracks, the protein name is forced onto the item name
+ if (title.search(/&hgg_prot=/) !== -1) {
+ title = title.split("&hgg_prot=")[0];
+ }
return title;
},
// when "exonNumbers on", the mouse over text is not a good item description for the right-click menu
// "exonNumbers on" is the default for genePred/bigGenePred tracks but can also be actived for bigBed and others
// We don't have the value of the tdb variable "exonNumbers" here, so just use a heuristic to see if it's on
mouseOverToExon: function(title)
{
var exonNum = 0;
var exonRe = /(Exon) ([1-9]+) /;
var matches = exonRe.exec(title);
if (matches !== null && matches[2].length > 0)
exonNum = matches[2];
return exonNum;
},
@@ -2949,31 +2953,31 @@
if (rec.type.indexOf("barChart") === 0
|| rec.type.indexOf("bigBarChart") === 0) {
let a = /i=([^&]+)/.exec(href);
if (a && a[1]) {
title = a[1];
}
}
}
// pick out the exon number from the mouseover text
// Probably should be a data-exonNum tag on the DOM element
var exonNum = rightClick.mouseOverToExon(title);
// remove special genePred exon mouseover html text
// CGIs now use HTML tags, e.g. "Transcript: ENST00000297261.7
Strand:"
- title = rightClick.mouseOverToLabel(title);
+ title = rightClick.mouseOverToLabel(decodeURIComponent(title));
if (title.length > maxLength) {
title = title.substring(0, maxLength) + "...";
}
if (isHgc && ( href.indexOf('g=gtexGene')!== -1
|| href.indexOf('g=unip') !== -1
|| href.indexOf('g=knownGene') !== -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.
let a = /i=([^&]+)/.exec(href);
if (a && a[1]) {
title = decodeURIComponent(a[1].replace(/\+/g, " "));
}
}