0c4f83cacbb6b3489d039e3207f39d1b54fb4591
chmalee
  Mon Nov 4 13:52:20 2024 -0800
Fix hgTracks track search tabs, the 'select' method has been deprecated so we weren't setting up dropdownchecklists when switching tabs, refs #34759

diff --git src/hg/js/ddcl.js src/hg/js/ddcl.js
index c271b2c..897b0be 100644
--- src/hg/js/ddcl.js
+++ src/hg/js/ddcl.js
@@ -320,31 +320,31 @@
         if (!id || id.length === 0) {
             var name = $(obj).attr('name');
             if (name && name.length > 0)
                 id = 'dd-' + name;
             else {
                 id = 'ix' +  $('select').index(obj);
             }
             $(obj).attr('id',id);
         } else {
             if (normed($('#ddcl-' + id)))    // Don't set up twice!
                 return;
         }
 
         // These values can only be taken from the select before it becomes a DDCL
         var maxWidth = $(obj).width();
-        if (maxWidth === 0) // currently hidden so wait for a reinit();
+        if (maxWidth <= 0) // currently hidden so wait for a reinit();
             return;
 
         var minWidth = $(obj).css('min-width');
         if (minWidth && minWidth.length > 0) { // Is a string, so convert and compare
             minWidth = parseInt(minWidth);
             if (maxWidth < minWidth)
                 maxWidth = minWidth;
         }
         maxWidth = (Math.ceil(maxWidth / 10) * 10) + 10; // Makes for more even boxes
         var style = $(obj).attr('style');
 
         // The magic starts here:
         $(obj).dropdownchecklist({
                             firstItemChecksAll: true,
                             noneIsAll: myNoneIsAll,