ad032e072d0427c066c425a88672288ed1b6c133 max Wed Jan 21 08:13:31 2026 -0800 fixes after code review and feedback from mark, refs #36978, and refs #36917 diff --git src/hg/hgTrackUi/hgTrackUi.c src/hg/hgTrackUi/hgTrackUi.c index e40cd0e0547..b54c78ee2ce 100644 --- src/hg/hgTrackUi/hgTrackUi.c +++ src/hg/hgTrackUi/hgTrackUi.c @@ -2760,74 +2760,76 @@ if (childRef == superTdb->children) // first time through { printf("\n"); printf("Apply visibility: \n"); printf("\n"); printInfoIcon("The 'Apply to all' button sets all tracks below to the visibility selected on this dropdown. The 'Apply to all visible' button sets this visibility on all tracks below that are not hidden."); + // First button: set all selectors that are not on 'hide' to the current value of the top select + printf("\n"); + jsOnEventById("click", "superVizApplyButton", "let newVal = $('#superSubViz').val(); $('#superTrackTable select').filter(function() { return $(this).val() !== 'hide'; }).val(newVal).trigger('change').removeClass('hiddenText').addClass('normalText'); "); + + // Second button: set all selectors to the current value of the top select printf(" \n"); - // set all selectors to the current value of the top select jsOnEventById("click", "superVizApplyAllButton", "let newVal = $('#superSubViz').val(); $('#superTrackTable select').val(newVal).trigger('change').removeClass('hiddenText').addClass('normalText');"); - // set all selectors that are not on 'hide' to the current value of the top select - printf("\n"); - jsOnEventById("click", "superVizApplyButton", "let newVal = $('#superSubViz').val(); $('#superTrackTable select').filter(function() { return $(this).val() !== 'hide'; }).val(newVal).trigger('change').removeClass('hiddenText').addClass('normalText'); "); printf("\n"); } printf(""); 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("", 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"), onlyVis, event); // print a group of buttons that act like radiobuttons (see javascript lines below) printf("
", tdb->track); char *trackVizStr = hStringFromTv(tv); - // vizList is e.g. {"Hide", "Dense", "Squish", "Pack", "Full"}, but can be shorter, e.g. when canPack=false + // 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("",buttonViz); + printf("%c%s", toupper((unsigned char)buttonViz[0]), buttonViz + 1); // upcase first letter + puts(""); } - puts(""); printf("\n"); hPrintPennantIcon(tdb); safef(id, sizeof id, "%s_link", tdb->track); // the