bfeae54a099bf1a9e2f29252b0ee581d2862ebf7
chmalee
  Wed Nov 29 12:07:15 2023 -0800
Make tooltip text size a configurable option in hgTracks config page, refs #32688

diff --git src/hg/js/utils.js src/hg/js/utils.js
index 87f4621..4b07a5e 100644
--- src/hg/js/utils.js
+++ src/hg/js/utils.js
@@ -4057,31 +4057,33 @@
         clearTimeout(mouseoverTimer);
     }
     mouseoverTimer = setTimeout(showMouseoverText, 300, e);
 }
 
 function addMouseover(ele1, text = null, ele2 = null) {
     /* Adds wrapper elements to control various mouseover events */
     if (!mouseoverContainer) {
         mouseoverContainer = document.createElement("div");
         mouseoverContainer.className = "tooltip";
         mouseoverContainer.style.position = "fixed";
         mouseoverContainer.style.display = "inline-block";
         mouseoverContainer.style.visibility = "hidden";
         mouseoverContainer.style.opacity = "0";
         mouseoverContainer.id = "mouseoverContainer";
-        mouseoverContainer.style.fontSize = window.browserTextSize + "px";
+        let tooltipTextSize = localStorage.getItem("tooltipTextSize");
+        if (tooltipTextSize === null) {tooltipTextSize = window.browserTextSize;}
+        mouseoverContainer.style.fontSize =  tooltipTextSize + "px";
         document.body.append(mouseoverContainer);
     }
     // create a mouseover element out of text, or, if text is null, use already
     // created ele2 and just show it
     newEl = ele2;
     if (text !== null) {
         newEl = document.createElement("span");
         newEl.style = "max-width: 400px"; // max width of the mouseover text
         newEl.innerHTML = text;
     } else {
         text = ele2.innerHTML;
         // if newEl was already created (as in on the server side), then
         // it may have had it's visibility hidden by default for page load purposes
         newEl.style.display = "inline-block";
     }