1c023be087f2ca548dd48a725289a73f8c577afd
tdreszer
  Tue Apr 19 16:54:51 2011 -0700
redmine 1411. One more tweek to martix CB graying.  This was found by Katrina when already on beta.
diff --git src/hg/js/hui.js src/hg/js/hui.js
index 5739640..e2d543c 100644
--- src/hg/js/hui.js
+++ src/hg/js/hui.js
@@ -412,36 +412,41 @@
 }
 
 function matCBsWhichAreComplete(complete)
 {
 // Returns a list of currently indeterminate matCBs.  This is encapsulated to keep consistent with matCbComplete()
     if(complete)
         return $("input.matCB").not(".halfVis");
     else
         return $("input.matCB.halfVis");
 }
 
 function matCbFindFromSubCb(subCB)
 {
 // returns the one matCB associated with a subCB (or undefined)
     var classList =  $( subCB ).attr("class").split(" ");
-    var classes = '.' + classList.slice(1,classList.length - 1).join('.');   // How to get only X and Y classes?  Assume they are the first 2 ("subCB GM12878 H3K4me3 rep1 p1" we only want ".GM12878.H3K4me3")
-    // At this point classes has been converted from "subCB 1GM12878 CTCF rep1 cHot" to ".1GM12878.CTCF"
-    var matCB = $("input.matCB"+classes); // NOte, this works for filtering multiple classes because we want AND
+    // we need one or 2 classes, depending upon how many dimensions in matrix (e.g. "subDB GM10847 NFKB aNone IGGrab Signal")
+    classList = aryRemove(classList,"subCB");
+    var classes = classList.slice(0,2).join('.');   // How to get only X and Y classes?  Assume they are the first 2
+    var matCB = $("input.matCB."+classes); // Note, this works for filtering multiple classes because we want AND
     if(matCB.length == 1)
         return matCB;
-    else
+
+    matCB = $("input.matCB."+classList[0]); // No hit so this must be a 1D matrix
+    if(matCB.length == 1)
+        return matCB;
+
         return undefined;
 }
 
 function matAbcCBfindFromSubCb(subCB)
 {
 // returns the abcCBs associated with a subCB (or undefined)
     var abcCBs = $("input.matCB.abc");
     if( abcCBs.length > 0 ) {
         var classList =  $( subCB ).attr("class").split(" ");
         classList = aryRemove(classList,"subCB");
         classList.shift(); // Gets rid of X and Y associated classes (first 2 after subCB)
         classList.shift();
         classList.pop();   // gets rid of view associated class (at end)
         if(classList.length >= 1) {
             var abcCB = $(abcCBs).filter('.'+classList.join("."));