969626a02833a352cab7e0d5f85140f3c9d8b890
larrym
  Fri Jul 29 20:07:45 2011 -0700
suppress printing of css and js includes when trackImgOnly is true
diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index fe5ec0e..43f6572 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -5862,69 +5862,72 @@
 char *configPageCall = cartCgiUsualString(cart, "hgTracksConfigPage", "notSet");
 
 dragZooming = advancedJavascriptFeaturesEnabled(cart);
 
 /* Do main display. */
 
 if (cartUsualBoolean(cart, "hgt.trackImgOnly", FALSE))
     {
     trackImgOnly = TRUE;
     ideogramToo = cartUsualBoolean(cart, "hgt.ideogramToo", FALSE);
     hideControls = TRUE;
     withNextItemArrows = FALSE;
     withNextExonArrows = FALSE;
     hgFindMatches = NULL;     // XXXX necessary ???
     }
-hWrites(commonCssStyles());
+
 jsonForClient = newJsonHash(newHash(8));
+boolean searching = differentString(cartUsualString(cart, TRACK_SEARCH,"0"),"0");
+
+if(!trackImgOnly)
+    {
+    // Write out includes for css and js files
+    hWrites(commonCssStyles());
 jsIncludeFile("jquery.js", NULL);
 jsIncludeFile("jquery-ui.js", NULL);
 jsIncludeFile("utils.js", NULL);
 jsIncludeFile("ajax.js", NULL);
-boolean searching = differentString(cartUsualString(cart, TRACK_SEARCH,"0"),"0");
 if(dragZooming && !searching)
     {
     jsIncludeFile("jquery.imgareaselect.js", NULL);
 #ifndef NEW_JQUERY
     webIncludeResourceFile("autocomplete.css");
     jsIncludeFile("jquery.autocomplete.js", NULL);
 #endif///ndef NEW_JQUERY
     }
     jsIncludeFile("autocomplete.js", NULL);
 jsIncludeFile("hgTracks.js", NULL);
 
 #ifdef LOWELAB
 jsIncludeFile("lowetooltip.js", NULL);
 #endif
 
 if(advancedJavascriptFeaturesEnabled(cart))
     {
     webIncludeResourceFile("jquery-ui.css");
     if (!searching) // NOT doing search
         {
         webIncludeResourceFile("jquery.contextmenu.css");
         jsIncludeFile("jquery.contextmenu.js", NULL);
         webIncludeResourceFile("ui.dropdownchecklist.css");
         jsIncludeFile("ui.dropdownchecklist.js", NULL);
 #ifdef NEW_JQUERY
         jsIncludeFile("ddcl.js", NULL);
 #endif///def NEW_JQUERY
         }
     }
 
-//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");
     }
 
 /* check for new data hub */
 if (cartVarExists(cart, hgHubDataText))
     {
     addDataHubs(cart);
     }
 
 if (cartVarExists(cart, "chromInfoPage"))
     {
     cartRemove(cart, "chromInfoPage");
     chromInfoPage();