1b1a0aa39ffd5c18dbb425fca096ea335ed154fe max Wed Mar 25 06:42:39 2026 -0700 superTrack hgTrackUi: auto-hide when all children hidden, grey dropdown on hide refs #37282 Route button clicks through superT.selChanged() by triggering the dropdown change event instead of just setting its value. This fixes three problems: (1) hiding all subtracks now auto-hides the superTrack container (matching composite track behavior), (2) the superTrack show/hide dropdown greys out when set to hide, and (3) clicking Hide on a subtrack no longer forces the superTrack to show. This makes the code actually simpler. I didn't know about selChanged() when I wrote the new superTrack code. Co-Authored-By: Claude Opus 4.6 (1M context) diff --git src/hg/hgTrackUi/hgTrackUi.c src/hg/hgTrackUi/hgTrackUi.c index cd3185f9527..aac0af2cdb3 100644 --- src/hg/hgTrackUi/hgTrackUi.c +++ src/hg/hgTrackUi/hgTrackUi.c @@ -2863,49 +2863,57 @@ printf("\n"); printf("%s ",tdb->shortLabel); } printf("\n"); printf("%s", tdb->longLabel); printf("  "); printDataVersion(database, tdb); //printf("  %s", dataVersion); printf(""); } printf(""); // Now configure the elements above with Javascript: -// * Clicking a button sets the dropdown to the button's text +// * Clicking a button sets the dropdown to the button's text and triggers change +// so superT.selChanged() runs (handles checkbox sync, hiddenText class, auto-show/hide superTrack) jsOnEventBySelector("click", ".seg-btn-group > button", "let dropdown = $('[name=\"' + $(this).parent().data('trackname')+'\"]'); " // cannot use #id, . has special meaning "let buttonText=$(this).text().toLowerCase(); " - "dropdown.val(buttonText).removeClass('hiddenText').addClass('normalText');" + "dropdown.val(buttonText).trigger('change');" ); // * Clicking buttons does not submit the form (default action of