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/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c index d32322cb54a..b2ff0e63e98 100644 --- src/hg/hgTracks/simpleTracks.c +++ src/hg/hgTracks/simpleTracks.c @@ -1171,31 +1171,31 @@ else if (revCmplDisp && (x+width) >= fullInsideWidth) { width -= (x+width) - fullInsideWidth + 1; if (width <= 1) { dyStringFree(&ui); return; } } //#ifdef IMAGEv2_SHORT_MAPITEMS // if (x < insideX && x+width > insideX) // warn("mapBoxReinvoke(%s) map item spanning slices. LX:%d TY:%d RX:%d BY:%d link:[%s]", // hStringFromTv(toggleGroup->visibility),x, y, x+width, y+height, link); //#endif//def IMAGEv2_SHORT_MAPITEMS imgTrackAddMapItem(curImgTrack,link,(char *)(message != NULL?message:NULL),x, y, x+width, - y+height, track ? track->track : NULL); + y+height, track ? track->track : NULL, message); } else { hPrintf("<AREA SHAPE=RECT COORDS=\"%d,%d,%d,%d\" ", x, y, x+width, y+height); hPrintf("HREF=\"%s?position=%s", hgTracksName(), pos); hPrintf("&%s\"", ui->string); if (message != NULL) mapStatusMessage("%s", message); hPrintf("%s>\n", dyStringContents(id)); } dyStringFree(&ui); dyStringFree(&id); } @@ -1270,55 +1270,57 @@ { // NOTE: chopped out winStart/winEnd // NOTE: Galt added winStart/winEnd back in for multi-region safef(link,sizeof(link),"%s&db=%s&c=%s&l=%d&r=%d&o=%d&t=%d&g=%s&i=%s", hgcNameAndSettings(), database, cgiEncode(chromName), winStart, winEnd, start, end, encodedTrack, encodedItem); } if (extra != NULL) safef(link+strlen(link),sizeof(link)-strlen(link),"&%s", extra); // Add map item to current map (TODO: pass in map) #ifdef IMAGEv2_SHORT_MAPITEMS if (!revCmplDisp && x < insideX && xEnd > insideX) x = insideX; else if (revCmplDisp && x < insideWidth && xEnd > insideWidth) xEnd = insideWidth - 1; #endif//def IMAGEv2_SHORT_MAPITEMS - imgTrackAddMapItem(curImgTrack,link,(char *)(statusLine!=NULL?statusLine:NULL), - x, y, xEnd, yEnd, track); + imgTrackAddMapItem(curImgTrack,link, encodedItem, + x, y, xEnd, yEnd, track, statusLine); } else { hPrintf("<AREA SHAPE=RECT COORDS=\"%d,%d,%d,%d\" ", x, y, xEnd, yEnd); if (directUrl) { hPrintf("HREF=\""); hPrintf(directUrl, item, chromName, start, end, encodedTrack, database); if (withHgsid) hPrintf("&%s", cartSidUrlString(cart)); } else { hPrintf("HREF=\"%s&o=%d&t=%d&g=%s&i=%s&c=%s&l=%d&r=%d&db=%s&pix=%d", hgcNameAndSettings(), start, end, encodedTrack, encodedItem, chromName, winStart, winEnd, database, tl.picWidth); } if (extra != NULL) hPrintf("&%s", extra); hPrintf("\" "); if (statusLine != NULL) - mapStatusMessage("%s", statusLine); + { + hPrintf(" TITLE='%s' data-tooltip='%s' ", item, statusLine); + } hPrintf("%s>\n", dyStringContents(id)); } freeMem(encodedItem); freeMem(encodedTrack); } dyStringFree(&id); } void mapBoxHc(struct hvGfx *hvg, int start, int end, int x, int y, int width, int height, char *track, char *item, char *statusLine) /* Print out image map rectangle that would invoke the hgc (human genome click) * program. */ { mapBoxHgcOrHgGene(hvg, start, end, x, y, width, height, track, item, statusLine, NULL, FALSE, NULL); }