16fcd800410b0c29be0564f2e657f30fa1862daf max Fri Jan 30 04:10:41 2026 -0800 fixing composite bug, refs #36917 diff --git src/hg/hgTrackUi/hgTrackUi.c src/hg/hgTrackUi/hgTrackUi.c index d6dcd0f4c02..1cbaeb179ee 100644 --- src/hg/hgTrackUi/hgTrackUi.c +++ src/hg/hgTrackUi/hgTrackUi.c @@ -2784,31 +2784,31 @@ } printf("<TR><TD NOWRAP>"); if (!tdbIsDownloadsOnly(tdb)) { char id[256]; enum trackVisibility tv = hTvFromString(cartUsualString(cart, tdb->track,hStringFromTv(tdb->visibility))); safef(id, sizeof id, "%s_check", tdb->track); printf("<INPUT style='display:none' class='subtrackCheckbox' TYPE=CHECKBOX id='%s'%s>", id, (tv != tvHide?" CHECKED":"")); safef(javascript, sizeof(javascript), "superT.selChanged(this)"); struct slPair *event = slPairNew("change", cloneString(javascript)); char *onlyVis = trackDbSetting(tdb, "onlyVisibility"); hTvDropDownClassVisOnlyAndExtra(tdb->track, tv, tdb->canPack, - (tv == tvHide ? "hiddenText":"normalText"), + (tv == tvHide ? "vizSelect hiddenText":"vizSelect normalText"), onlyVis, event); // print a group of buttons that act like radiobuttons (see javascript lines below) printf("<div data-trackname='%s' class='seg-btn-group' style='margin-right:12px'>", tdb->track); char *trackVizStr = hStringFromTv(tv); // vizList is e.g. {"hide", "dense", "squish", "pack", "full"}, but can be shorter, e.g. when canPack=false char **vizList = hTvGetVizArr(tv, tdb->canPack, onlyVis); int vizListLen = arrNullLen(vizList); for (int i = 0; i < vizListLen; i++) { char *buttonViz = vizList[i]; // the currently active viz mode is an 'active' button = pressed if (strcasecmp(buttonViz, trackVizStr) == 0) printf("<button class='seg-active'>"); @@ -2840,33 +2840,34 @@ printf("<TD>%s", tdb->longLabel); printf(" "); printDataVersion(database, tdb); //printf(" <EM style='color:#666666; font-size:smaller;'>%s</EM>", dataVersion); printf("</TD></TR>"); } printf("</TABLE>"); // Now configure the elements above with Javascript: // * Clicking a button sets the dropdown to the button's text jsOnEventBySelector("click", ".seg-btn-group > button", "let dropdown = $('#' + $(this).parent().data('trackname')); let buttonText=$(this).text().toLowerCase(); dropdown.val(buttonText).removeClass('hiddenText').addClass('normalText');"); // * Clicking buttons does not submit the form (default action of <button> is to submit, unless type=button) jsInline("$('.seg-btn-group button').attr('type', 'button');"); -// * Clicking buttons makes them pressed +// * Clicking buttons makes them pressed. Also, clicking any button shows the superTrack jsInline("$('.seg-btn-group').on('click', 'button', function() {" "$(this).addClass('seg-active').siblings().removeClass('seg-active');" + "$('.superDropdown').val('show');" "});"); // * Changing the dropdown updates the buttons jsInline("$('.vizSelect').on('change', function() {" "$(this).next().children().removeClass('seg-active');" "let labelToFind = capitalizeFirstLetter($(this).val());" "$(this).next().find('button').filter(function() { return $(this).text().trim() === labelToFind; }).addClass('seg-active');" "});"); // * Hide all subtrack dropdowns from the user. They are used so the CGI arguments // are sent to hgTracks, but are not necessary as UI elements anymore jsInline("$('#superTrackTable .vizSelect').hide();"); } #ifdef USE_HAL static void cfgHalSnake(struct trackDb *tdb, char *name) { @@ -3668,31 +3669,34 @@ tdb->canPack = TRUE; else if (!startsWith("bigWig", tdb->type) && startsWith("big", tdb->type)) tdb->canPack = TRUE; else if (sameString(tdb->type, "bigNarrowPeak")) tdb->canPack = TRUE; else if (sameString(tdb->type, "hic")) tdb->canPack = TRUE; // Don't bother with vis controls for downloadsOnly if (!tdbIsDownloadsOnly(tdb)) { /* Display visibility menu */ if (tdbIsComposite(tdb) && multViewCount(tdb) > 0) printf("<B>Maximum display mode: </B>"); else if (tdbIsSuper(tdb)) + { printf("<B>Show or hide this container and all tracks: </B>"); + printInfoIcon("Switching off the entire container here will preserve the visibility settings below, so you can come back later and restore the visibility settings again with a single click."); + } else printf("<B>Display mode: </B>"); if (tdbIsSuper(tdb)) { superTrackDropDown(cart, tdb, 1); } else { /* normal visibility control dropdown */ enum trackVisibility vis = tdb->visibility; boolean canPack = rTdbTreeCanPack(tdb); if (ajax) { // ajax popups should show currently inherited visability