c5e7f5a7ca22c7e4cd3fc692ecab55c10a04dce4 braney Fri Feb 8 14:07:20 2019 -0800 use _hideKids instead of _sel to hide the children of composites and supertracks diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index 1a2c079..fa2f566 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -6880,48 +6880,47 @@ { track->tdb->parent->visibility = hTvFromString(s) ; cartSetString(cart, track->tdb->parent->track, s); } else if (startsWith("hub_", track->tdb->parent->track)) { s = hideTracks ? cgiOptionalString( trackHubSkipHubName(track->tdb->parent->track)) : cartOptionalString( cart, trackHubSkipHubName(track->tdb->parent->track)); if (s) { cartSetString(cart, track->tdb->parent->track, s); cartRemove(cart, trackHubSkipHubName(track->tdb->parent->track)); // remove the undecorated version track->tdb->parent->visibility = hTvFromString(s) ; } } - // now look to see if we have a _sel statement to turn off all subtracks (including the current one) - unsigned hideChildren = 0; + // now look to see if we have a _hideKids statement to turn off all subtracks (including the current one) + unsigned hideKids = 0; char *usedThis = buffer; - safef(buffer, sizeof buffer, "%s_sel", track->tdb->parent->track); + safef(buffer, sizeof buffer, "%s_hideKids", track->tdb->parent->track); s = cartOptionalString(cart, buffer); if (s == NULL && startsWith("hub_", track->tdb->parent->track)) s = cartOptionalString(cart, usedThis = trackHubSkipHubName(buffer)); if (s != NULL) { - if (sameString(s, "0")) - hideChildren = 1; + hideKids = 1; cartRemove(cart, usedThis); // we don't want this hanging out in the cart } // mark this as having been addressed - hel = hashAddInt(superTrackHash, track->tdb->parent->track, hideChildren ); + hel = hashAddInt(superTrackHash, track->tdb->parent->track, hideKids ); } if ( ptToInt(hel->val) == 1) // we want to hide this track { if (tvHide == track->tdb->visibility) /* remove if setting to default vis */ cartRemove(cart, track->track); else cartSetString(cart, track->track, "hide"); track->visibility = tvHide; } } // we use cgiOptionString because the above code may have turned off the track in the cart if // the user requested that all the default tracks be turned off @@ -6942,59 +6941,59 @@ 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)) { char *usedThis = buffer; // first check to see if we've been asked to hide all the subtracks - boolean hideChildren = FALSE; - safef(buffer, sizeof buffer, "%s_sel", track->track); + 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) && (sameString(s, "0"))) - hideChildren = TRUE; - cartRemove(cart, usedThis); // we don't want these _sel variables in the cart + hideKids = TRUE; + cartRemove(cart, usedThis); // we don't want these _hideKids variables in the cart // now see if we have any specified visibilities struct track *subtrack; for (subtrack = track->subtracks; subtrack != NULL; subtrack = subtrack->next) { char *s = hideTracks ? cgiOptionalString( subtrack->track) : cartOptionalString(cart, subtrack->track); if (s == NULL && startsWith("hub_", subtrack->track)) s = hideTracks ? cgiOptionalString(trackHubSkipHubName(subtrack->track)) : cartOptionalString(cart, trackHubSkipHubName(subtrack->track)); 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"); } - else if (hideChildren && isSubtrackVisible(subtrack)) + else if (hideKids && isSubtrackVisible(subtrack)) cartSetString(cart, buffer, "0"); } } } 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)); }