src/hg/hgTracks/config.c 1.77
1.77 2009/04/06 20:51:50 tdreszer
Made hgTracks expand/colapse groups work identiacally between config and image version
Index: src/hg/hgTracks/config.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTracks/config.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -b -B -U 4 -r1.76 -r1.77
--- src/hg/hgTracks/config.c 9 Feb 2009 22:07:04 -0000 1.76
+++ src/hg/hgTracks/config.c 6 Apr 2009 20:51:50 -0000 1.77
@@ -95,13 +95,14 @@
&indicator, &otherState);
hTableStart();
hPrintf("<TR NOWRAP>");
hPrintf("<TH NOWRAP align=\"left\" colspan=3 BGCOLOR=#536ED3>");
- hPrintf("\n<A NAME=\"%s\"></A>",group->name);
- hPrintf("<A HREF=\"%s?%s&hgTracksConfigPage=configure&%s=%s#%s\" class=\"bigBlue\"><IMG height=22 width=22 src=\"%s\" alt=\"%s\" class=\"bigBlue\"></A> ",
- hgTracksName(), cartSidUrlString(cart),
- collapseGroupVar(group->name),
- otherState, group->name, indicatorImg, indicator);
+ hPrintf("\n<A NAME='%sGroup'></A>",group->name);
+ hPrintf("<input type=hidden name='%s' id='%s' value=%d>",
+ collapseGroupVar(group->name),collapseGroupVar(group->name), (isOpen?0:1));
+ hPrintf("<A HREF='%s?%s&%s=%s#%sGroup' class='bigBlue'><IMG height=22 width=22 onclick=\"return toggleTrackGroupVisibility(this,'%s');\" id='%s_button' src='%s' alt='%s' class='bigBlue'></A> ",
+ hgTracksName(), cartSidUrlString(cart),collapseGroupVar(group->name),
+ otherState, group->name, group->name, group->name, indicatorImg, indicator);
hPrintf("<B> %s</B> ", wrapWhiteFont(group->label));
hPrintf(" ");
hPrintf("<INPUT TYPE=SUBMIT NAME=\"%s\" VALUE=\"%s\" "
"onClick=\"document.mainForm.%s.value='%s'; %s\">",
@@ -143,24 +144,14 @@
hPrintf("\n");
}
hPrintf("</TR>\n");
- if (!isOpen)
- {
- /* finish group section here if it's collapsed */
- hTableEnd();
- hPrintf("<BR>");
- if (differentString(group->name, "user"))
- isFirstNotCtGroup = FALSE;
- continue;
- }
-
/* First non-CT group gets ruler. */
if (!showedRuler && isFirstNotCtGroup &&
differentString(group->name, "user"))
{
showedRuler = TRUE;
- hPrintf("<TR>");
+ hPrintf("<TR %sid='%s-0'>",(isOpen ? "" : "style='display: none'"), group->name);
hPrintf("<TD>");
hPrintf("<A HREF=\"%s?%s=%u&c=%s&g=%s&hgTracksConfigPage=configure\">", hgTrackUiName(),
cartSessionVarName(), cartSessionId(cart),
chromName, RULER_TRACK_NAME);
@@ -219,14 +210,15 @@
group->trackList = refList;
}
/* Loop through this group and display */
+ int rowCount=1;
for (tr = group->trackList; tr != NULL; tr = tr->next)
{
struct track *track = tr->track;
struct trackDb *tdb = track->tdb;
- hPrintf("<TR>");
+ hPrintf("<TR %sid='%s-%d'>",(isOpen ? "" : "style='display: none'"),group->name, rowCount++);
hPrintf("<TD NOWRAP>");
if (tdbIsSuperTrackChild(tdb))
/* indent members of a supertrack */
hPrintf(" ");
@@ -428,11 +420,11 @@
cgiMakeButton(configShowAll, "show all");
hPrintf(" ");
cgiMakeButton(configDefaultAll, "default");
hPrintf(" Groups: ");
-cgiMakeButton(configHideAllGroups, "collapse all");
+hButtonWithOnClick("hgt.collapseGroups", "collapse all", "collapse all track groups", "return setAllTrackGroupVisibility(false)");
hPrintf(" ");
-cgiMakeButton(configShowAllGroups, "expand all");
+hButtonWithOnClick("hgt.expandGroups", "expand all", "expand all track groups", "return setAllTrackGroupVisibility(true)");
hPrintf("<P STYLE=\"margin-top:5;\">Control track and group visibility more selectively below.<P>");
trackConfig(trackList, groupList, groupTarget, vis);
dyStringFree(&title);