a1df14efb5885e1059b25bed1033a2d3922ed711
chmalee
  Tue Nov 7 10:15:23 2023 -0800
Make all elements with a title attribute use the new mouseover code, not just those elements in the imgTbl or ideoMap, refs Max email

diff --git src/hg/js/utils.js src/hg/js/utils.js
index 008cfd6..2233eaa 100644
--- src/hg/js/utils.js
+++ src/hg/js/utils.js
@@ -4096,60 +4096,64 @@
         }
         ele1.setAttribute("mouseoverid", newDiv.id);
         newDiv.append(newEl);
         ele1.parentNode.append(newDiv);
         ele1.addEventListener("mouseover", showMouseover);
     }
 }
 
 function titleTagToMouseover(mapEl) {
     /* for a given area tag, extract the title text into a div that can be positioned
     * like a standard tooltip mouseover next to the item */
     addMouseover(mapEl, mapEl.title);
 }
 
 function convertTitleTagsToMouseovers() {
-    /* make all the title tags in the ideogram or main image have mouseovers */
-    $("[name=ideoMap]>[title],#imgTbl [title]").each(function(i, a) {
+    /* make all the title tags in the document have mouseovers */
+    $("[[title]").each(function(i, a) {
         if (a.title !== undefined && a.title.length > 0) {
             titleTagToMouseover(a);
         }
     });
+
+    /* make the above mouseovers go away if we are in an input or select menu */
     const inps = document.getElementsByTagName("input");
     const sels = document.getElementsByTagName("select");
     for (let inp of inps) {
         if (!(inp.type == "hidden" || inp.type == "HIDDEN")) {
             inp.addEventListener("focus", (ev) => {
                 hideMouseoverText(mouseoverContainer);
                 mousemoveController.abort();
                 canShowNewMouseover = false;
             });
             inp.addEventListener("blur", (evt) => {
                 canShowNewMouseover = true;
             });
         }
     }
     for (let sel of sels) {
         sel.addEventListener("focus", (ev) => {
             hideMouseoverText(mouseoverContainer);
             mousemoveController.abort();
             canShowNewMouseover = false;
         });
         sel.addEventListener("blur", (evt) => {
             canShowNewMouseover = true;
         });
     }
+
+    /* for hgTracks specifically, we also need to deal with the special contextmenu */
     let imgTbl = document.getElementById("imgTbl");
     if (imgTbl) {
         imgTbl.addEventListener("contextmenu", function(e) {
             hideMouseoverText(mouseoverContainer);
             mousemoveController.abort();
             canShowNewMouseover = false;
             // right-click menu doesn't capture focus so manually catch it
             document.addEventListener("click", function(ev) {
                 // there is a race condition where the close happens after an inputs
                 // focus happens, which means mouseovers get re-enabled when the focus
                 // on the input should prevent them, catch that here:
                 if (!(document.activeElement.tagName === "INPUT" ||
                         document.activeElement === "SELECT")) {
                     canShowNewMouseover = true;
                 }