753b10b19784b1d07abaf7ec6b827c752e40416f
Merge parents 4880079 9c65dec
tdreszer
  Wed Nov 30 12:27:45 2011 -0800
Merge-o-rama
diff --cc src/hg/js/hui.js
index f7e63b9,3e2085c..4d6b3fd
--- src/hg/js/hui.js
+++ src/hg/js/hui.js
@@@ -1237,65 -1272,90 +1237,93 @@@
                      break;
                  }
                  if (cell.title.length > 0)
                      cell.title += " and ";
                  cell.title += $("th."+classList[ix]).first().text();
              }
          }
      },
  
      clearGhostHilites: function ()
      {
          $('.matCell').css({backgroundColor:""});
          $(mat.matrix).find('tr').css({backgroundColor:""});
      },
  
+     resizeAngleLabels: function ()
+     {   // Sets the height on the angled matrix labels
+         var longest = "";
+         var up45 = $('div.up45');
+         $(up45).each(function (i) {
+             if (longest.length < $(this).text().length)
+                 longest = $(this).text();
+         });
+         if (longest.length > 5) {
+             $(mat.matrix).append("<span id='noShow' style='color:#FFF9D2;'>"+longest+"</span>");
+             var noShow = $('span#noShow');
+             var newHeight = ($(noShow).width() * 0.9) + 10;
+             if (newHeight < 20)
+                 newHeight = longest.length * 7;
+             $(up45).first().parent('th').css('height',newHeight + 'px');
+             $(up45).show();
+             var dn45 = $('div.dn45');
+             if (dn45 != undefined && dn45.length > 0) {
+                 $(dn45).first().parent('th').css('height',newHeight + 'px');
+                 $(dn45).show();
+             }
+             $(noShow).remove();
+         }
+     },
+ 
      init: function ()
      {
-         mat.matrix = normed($('table.matrix'));
-         if (mat.matrix != undefined) {
-             var cells = $('td.matCell');
-             if (cells != undefined && cells.length > 0) {
-                 var classList = $( cells[0] ).attr("class").split(" ");
-                 classList = aryRemove(classList,["matCell"]);
-                 mat.dimensions = classList.length;
-                 if (mat.dimensions > 1) { // No need unless this is a 2D matrix
-                     $('.matCell').hover(
-                         function (e) {mat.cellHover(this,true)},
-                         function (e) {mat.cellHover(this,false)}
-                     );
-                     $(mat.matrix).blur(mat.clearGhostHilites());
-                     $(window).bind('focus',function (e) {mat.clearGhostHilites();}); // blur doesn't work because the screen isn't repainted
+         mat.matrix = $('table.matrix');
+         if (mat.matrix != undefined && mat.matrix.length == 1) {
+             mat.resizeAngleLabels();
+             if (!$.browser.msie) { // IE can't handle the hover!
+                 var cells = $('td.matCell');
+                 if (cells != undefined && cells.length > 0) {
+                     var classList = $( cells[0] ).attr("class").split(" ");
+                     classList = aryRemove(classList,["matCell"]);
+                     mat.dimensions = classList.length;
+                     if (mat.dimensions > 1) { // No need unless this is a 2D matrix
+                         $('.matCell').hover(
+                             function (e) {mat.cellHover(this,true)},
+                             function (e) {mat.cellHover(this,false)}
+                         );
+                         $(mat.matrix).blur(mat.clearGhostHilites());
+                         $(window).bind('focus',function (e) {mat.clearGhostHilites();}); // blur doesn't work because the screen isn't repainted
+                     }
                  }
              }
          }
      }
  }
  
  // The following js depends upon the jQuery library
  $(document).ready(function()
  {
      mat.init();
  
 +    if (normed($('table.subtracks')) != undefined) {
 +        matInitializeMatrix();
 +
 +        // If divs with class 'subCfg' then initialize the subtrack cfg code
 +        // NOTE: must be before any ddcl setup
 +        if (typeof(subCfg) !== "undefined" && normed($("div.subCfg")) != undefined) {
 +            subCfg.initialize();
 +        }
 +    }
 +
      // Initialize sortable tables
      $('table.sortable').each(function (ix) {
          sortTableInitialize(this,true,true);
      });
  
      // Register tables with drag and drop
      $("table.tableWithDragAndDrop").each(function (ix) {
          tableDragAndDropRegister(this);
      });
  
 -    $('.halfVis').css('opacity', '0.5'); // The 1/2 opacity just doesn't get set from cgi!
 -
 -    $('.filterComp').each( function(i) { // Do this by 'each' to set noneIsAll individually
 -        if (newJQuery == false)
 -            $(this).dropdownchecklist({ firstItemChecksAll: true, noneIsAll: $(this).hasClass('filterBy'), maxDropHeight: filterByMaxHeight(this) });
 -    });
 -
      // Put navigation links in top corner
      navigationLinksSetup();
  });