d51d9c7500b784d5ad684f9b3c5f56ff7c7d29c2
tdreszer
  Thu Jan 27 12:23:26 2011 -0800
Fix bug Hiram pointed out and fixed bug where selectingh track search from gateway sometimes landed on configuretracks  page instead
diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index 75032a6..0979185 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -2298,31 +2298,31 @@
     leftLabelX = leftLabelWidth = 0;
     }
 
 /* Draw guidelines. */
 if (withGuidelines)
     {
     struct hvGfx *bgImg = hvg; // Default to the one image
     boolean exists = FALSE;
     if(theImgBox)
         {
         struct tempName gifBg;
         char base[64];
         safef(base,sizeof(base),"blueLines%d-%s%d-%d",pixWidth,(revCmplDisp?"r":""),insideX,guidelineSpacing);  // reusable file needs width, leftLabel start and guidelines
         exists = trashDirReusableFile(&gifBg, "hgt", base, ".png");
         if (exists && cgiVarExists("hgt.reset")) // exists means don't remake bg image.
-            exists = TRUE;                       // However, for the time being, rebuild when user presses "default tracks"
+            exists = FALSE;                       // However, for the time being, rebuild when user presses "default tracks"
 
         if (!exists)
             {
             bgImg = hvGfxOpenPng(pixWidth, pixHeight, gifBg.forCgi, TRUE);
             bgImg->rc = revCmplDisp;
             }
         imgBoxImageAdd(theImgBox,gifBg.forHtml,NULL,pixWidth, pixHeight,TRUE); // Adds BG image
         }
 
     if (!exists)
         {
         int x;
         Color lightBlue = hvGfxFindRgb(bgImg, &guidelineColor);
 
         hvGfxSetClip(bgImg, insideX, 0, insideWidth, pixHeight);
@@ -5581,30 +5581,34 @@
 #endif/// def CONTEXT_MENU
     }
 jsIncludeFile("jquery-ui.js", NULL);
 
 //if (!trackImgOnly)
     {
 hPrintf("<div id='hgTrackUiDialog' style='display: none'></div>\n");
 // XXXX stole this and '.hidden' from bioInt.css - needs work
 hPrintf("<div id='warning' class='ui-state-error ui-corner-all hidden' style='font-size: 0.75em; display: none;' onclick='$(this).hide();'><p><span class='ui-icon ui-icon-alert' style='float: left; margin-right: 0.3em;'></span><strong></strong><span id='warningText'></span> (click to hide)</p></div>\n");
     }
 if (cartVarExists(cart, "chromInfoPage"))
     {
     cartRemove(cart, "chromInfoPage");
     chromInfoPage();
     }
+else if (differentString(cartUsualString(cart, TRACK_SEARCH,"0"),"0"))
+    {
+    doSearchTracks(groupList);
+    }
 else if (sameWord(configPageCall, "configure") ||
     sameWord(configPageCall, "configure tracks and display"))
     {
     cartRemove(cart, "hgTracksConfigPage");
     configPage();
     }
 else if (cartVarExists(cart, configHideAll))
     {
     cartRemove(cart, configHideAll);
     configPageSetTrackVis(tvHide);
     }
 else if (cartVarExists(cart, configShowAll))
     {
     cartRemove(cart, configShowAll);
     configPageSetTrackVis(tvDense);
@@ -5638,33 +5642,29 @@
     for (grp = grps; grp != NULL; grp = grp->next)
         if (startsWith("encode", grp->name))
             collapseGroup(grp->name, TRUE);
     configPageSetTrackVis(-2);
     }
 else if (cartVarExists(cart, configShowEncodeGroups))
     {
     /* currently not used */
     cartRemove(cart, configShowEncodeGroups);
     struct grp *grp = NULL, *grps = hLoadGrps(database);
     for (grp = grps; grp != NULL; grp = grp->next)
         if (startsWith("encode", grp->name))
             collapseGroup(grp->name, FALSE);
     configPageSetTrackVis(-2);
     }
-else if (differentString(cartUsualString(cart, TRACK_SEARCH,"0"),"0"))
-    {
-    doSearchTracks(groupList);
-    }
 else
     {
     tracksDisplay();
     }
 }
 
 void doDown(struct cart *cart)
 {
 printf("<H2>The Browser is Being Updated</H2>\n");
 printf("The browser is currently unavailable.  We are in the process of\n");
 printf("updating the database and the display software with a number of\n");
 printf("new tracks, including some gene predictions.  Please try again tomorrow.\n");
 }