742b807bec5f518fc190023cc619c61103c2b5b6
braney
  Thu Dec 12 09:48:07 2019 -0800
support _sel and _hideKids in multiwigs #24544

diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index a7f970b..393a075 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -6958,31 +6958,31 @@
         }
     else
         {
         // maybe this track is on the URL without the hub_ prefix
         if (startsWith("hub_", track->track))
             s = cgiOptionalString(trackHubSkipHubName(track->track));
         if (s != NULL && !track->limitedVisSet)
             {
             track->visibility = hTvFromString(s);
             cartSetString(cart, track->track, s);   // add the decorated visibility to the cart
             cartRemove(cart, trackHubSkipHubName(track->track)); // remove the undecorated version
             }
         }
 
     // now deal with composite track children
-    if (tdbIsComposite(track->tdb))
+    if (tdbIsComposite(track->tdb) || tdbIsMultiTrack(track->tdb))
         {
         char *usedThis = buffer;
 
         // first check to see if we've been asked to hide all the subtracks
         boolean hideKids = FALSE;
         safef(buffer, sizeof buffer, "%s_hideKids", track->track);
 
         s = cartOptionalString(cart, buffer);
         if (s == NULL && startsWith("hub_", track->track))
             s = cartOptionalString(cart, usedThis = trackHubSkipHubName(buffer));
         if (s != NULL)
             hideKids = TRUE;
         cartRemove(cart, usedThis);   // we don't want these _hideKids variables in the cart
 
         // now see if we have any specified visibilities
@@ -6998,31 +6998,35 @@
                 }
 
             safef(buffer, sizeof buffer, "%s_sel", subtrack->track);
             if (s != NULL)
                 {
                 subtrack->visibility = hTvFromString(s);
                 cartSetString(cart, subtrack->track, s);
                 if (sameString("hide", s))
                     cartSetString(cart, buffer, "0");
                 else
                     cartSetString(cart, buffer, "1");
                 if (undecoratedVis)
                     cartRemove(cart, trackHubSkipHubName(subtrack->track)); // remove the undecorated version
                 }
             else if (hideKids && isSubtrackVisible(subtrack))
+                {
                 cartSetString(cart, buffer, "0");
+                subtrack->subTrackVis = tvHide;
+                subtrack->subTrackVisSet = TRUE;
+                }
             }
         }
     }
 return trackList;
 }
 
 char *collapseGroupVar(char *name)
 /* Construct cart variable name for collapsing group */
 {
 static char varName[256];
 safef(varName, sizeof(varName),
         "%s%s_%s_%s", "hgt", "group", name, "close");
 return (cloneString(varName));
 }