d147153dbb70eb9018b248543b6f39dde939076a
tdreszer
  Fri Oct 7 16:52:46 2011 -0700
Another set of fixes propted by going through all of hg19 again and another 7 assemblies from different species and clades.
diff --git src/hg/js/subCfg.js src/hg/js/subCfg.js
index 9c2241c..990a97e 100644
--- src/hg/js/subCfg.js
+++ src/hg/js/subCfg.js
@@ -41,31 +41,31 @@
 //  - Remove debug code when ready
 // NOTE:
 // Current implementation relies upon '.' delimiter in name and no '_-' in name.  Nothing breaks rule yet...
 
 var subCfg = { // subtrack config module.
     //mySelf: null, // There is no need for a "mySelf" unless this object is being instantiated.
 
     // There is one instance and these vars are page wide
     compositeName: undefined,
     visIndependent: false,
     viewTags: [],
 
     markChange: function (eventObj, obj)
     { // Marks a control as having been changed by the user.  Naming will send value to cart.
       // Note this is often called directly as the onchange event function
-        if (obj == undefined)
+        if (obj == undefined || $.type(obj) === "string")
             obj = this;
         $(obj).addClass('changed');
 
         // checkboxes have hidden boolshads which should be marked when unchecked
         if(obj.type === "checkbox") {
             var boolshad = normed($("input.cbShadow[name='boolshad\\." + obj.name+"']"));
             if (boolshad != undefined) {
                 $(boolshad).addClass('changed');
             }
         }
     },
 
     clearChange: function (obj)
     { // Mark as unchanged
         $(obj).removeClass('changed');
@@ -682,32 +682,36 @@
         if (subFaux != undefined) {
             if (setTo == true)
                 $(subFaux).removeClass('disabled');
             else
                 $(subFaux).addClass('disabled');
         } else {
             var subVis = normed($(td).find('select.subVisDD'));
             if (subVis != undefined) {
                 $(subVis).attr('disabled',!setTo);
             }
         }
         var wrench = normed($(td).find('span.clickable')); // TODO tighten this
         if (wrench != undefined) {
             if (setTo == true)
                 $(wrench).removeClass('disabled');
-            else
+            else {
                 $(wrench).addClass('disabled');
+                var cfg = normed($(td).parent('tr').find('div.subCfg'));
+                if (cfg != undefined)
+                    $(cfg).hide();
+            }
         }
     },
 
     cfgToggle: function (wrench,subtrack)
     { // Opens/closes subtrack cfg dialog, populating if empty
         var cfg = normed($("div#div_cfg_"+subtrack));
         if (cfg == undefined) {
             warn("DEBUG: Can't find div_cfg_"+subtrack);
             return false;
         }
 
         if ($(cfg).css('display') == 'none') {
             if ($(wrench).hasClass('disabled'))
                 return;
             // Don't allow if this composite is not enabled!