aee2779a0e183ca9f694ade76ac95b18aef49a55
max
  Mon Feb 16 17:22:22 2026 -0800
replacing dense jquery code with more explicit code and also fixing the case Gerardo found when a track does not have pack mode, refs #36917

diff --git src/hg/js/hui.js src/hg/js/hui.js
index ddd9975eb0d..75bd9eb7fd9 100644
--- src/hg/js/hui.js
+++ src/hg/js/hui.js
@@ -1574,15 +1574,35 @@
 
     // update the color picker if you change the input box
     $(inpText).on("change", function() {
         $(inpSpec).spectrum("set", $(inpText).val());
         saveHlColor($(inpText).val(), trackName);
     });
     // Restore the default on Reset link click
     $(inpResetLink).on("click", function() {
         let hlDefault = hlColorDefault;
         $(inpText).val(hlDefault);
         $(inpSpec).spectrum("set", hlDefault);
         saveHlColor(hlDefault, trackName);
     });
     $(inpSpec).spectrum("set", $(inpText).val());
 }
+
+function superUiSetAllTracks(onlyVisible) {
+    /* called when user clicks the 'Apply to all' buttons: sets all viz dropdowns to the #superSubViz value */
+    let newVal = $('#superSubViz').val();
+    var selects = document.querySelectorAll('#superTrackTable select');
+    for (var i = 0; i < selects.length; i++) {
+        var sel = selects[i];
+        if (sel.id==="superSubViz")
+            continue;
+        if (onlyVisible && sel.value === 'hide')
+            continue;
+        sel.value = newVal;
+        // if the dropdown cannot be set to a value (e.g. bigWig has no pack), set it to full or dense
+        if (sel.value === "")
+            sel.value = 'full';
+        if (sel.value === "")
+            sel.value = 'dense';
+        $(sel).trigger("change");
+    }
+}