69e8424f77f7d2513fcf8082aea972d539665540
tdreszer
  Fri Nov 18 13:14:56 2011 -0800
More touches on BUTTONS_BY_CSS
diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js
index 823b28c..618fe04 100644
--- src/hg/js/hgTracks.js
+++ src/hg/js/hgTracks.js
@@ -436,32 +436,31 @@
 
     toggleForGroup: function (button, prefix)
     {   // toggle visibility of a track group; prefix is the prefix of all the id's of tr's in the
         // relevant group. This code also modifies the corresponding hidden fields and the gif of the +/- img tag.
         imageV2.markAsDirtyPage();
         if(arguments.length > 2)
             return setTableRowVisibility(button, prefix, "hgtgroup", "group",false,arguments[2]);
         else
             return setTableRowVisibility(button, prefix, "hgtgroup", "group",false);
     },
 
     expandAllGroups: function (newState)
     {   // Set visibility of all track groups to newState (true means expanded).
         // This code also modifies the corresponding hidden fields and the gif's of the +/- img tag.
         imageV2.markAsDirtyPage();
-        $("img[id$='_button']").each( function (i) {
-            if(this.src.indexOf("/remove") > 0 || this.src.indexOf("/add") > 0)
+        $(".toggleButton[id$='_button']").each( function (i) {  // works for old img type AND new BUTTONS_BY_CSS
                 vis.toggleForGroup(this,this.id.substring(0,this.id.length - 7),newState); // clip '_button' suffix
         });
         return false;
     }
 
 }
   ////////////////////////////////////////////////////////////
  // dragSelect is also known as dragZoom or shift-dragZoom //
 ////////////////////////////////////////////////////////////
 var dragSelect = {
 
     areaSelector:    null, // formerly "imgAreaSelect". jQuery element used for imgAreaSelect
     autoHideSetting: true, // Current state of imgAreaSelect autoHide setting
     originalCursor:  null,
     startTime:       null,