src/hg/js/hui.js 1.56

1.56 2010/05/24 23:01:21 tdreszer
If one filter box is not selected, then other filterboxes exclude nothing
Index: src/hg/js/hui.js
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/js/hui.js,v
retrieving revision 1.55
retrieving revision 1.56
diff -b -B -U 4 -r1.55 -r1.56
--- src/hg/js/hui.js	24 May 2010 21:12:17 -0000	1.55
+++ src/hg/js/hui.js	24 May 2010 23:01:21 -0000	1.56
@@ -1109,24 +1109,23 @@
                 possibleSelections = possibleSelections.concat(possibleClasses);
         });
         if( $ (possibleSelections).length > 0) // clean out tags from other dimensions
             possibleSelections = aryRemoveVals(possibleSelections,allSelectedTags);
-        possibleSelections.push('All'); // All should be allowed
     }
 
     // Walk through all options in this filterBox to set excluded class
     //warn(possibleSelections,toString());
     var updated = false;
     var opts = $(obj).children("option");
-    for(var ix = 0;ix < $(opts).length;ix++) {
-        if(possibleSelections.length > 0 && aryFind(possibleSelections,opts[ix].value) > -1) {
-            if($(opts[ix]).hasClass('excluded')) {
+    for(var ix = 1;ix < $(opts).length;ix++) { // All is always allowwed
+        if(!oneEmpty && possibleSelections.length > 0 && aryFind(possibleSelections,opts[ix].value) == -1) {
+            if($(opts[ix]).hasClass('excluded') == false) {
+                $(opts[ix]).addClass('excluded');
+                updated = true;
+        } else if($(opts[ix]).hasClass('excluded')) {
                 $(opts[ix]).removeClass('excluded');
                 updated = true;
             }
-        } else if($(opts[ix]).hasClass('excluded') == false) {
-            $(opts[ix]).addClass('excluded');
-            updated = true;
         }
     }
     return updated;
 }