9bab882abcb4115c3e43e5c9b49de5ccbdb91c9f chmalee Tue Apr 28 14:47:14 2026 -0700 Make hgTrackUi popup scroll vertically when content would overflow the regular size of the dialog, like in the case of toggling the density graph option, refs #37443 diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 4731835736a..33a2458b56e 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -4247,42 +4247,35 @@ modal: true, closeOnEscape: true, autoOpen: false, buttons: uiDialogButtons, // popup.ready() doesn't seem to work in open. open: function(event) { // fix popup to a location -- near the top and somewhat centered on the browser image $(event.target).parent().css('position', 'fixed'); $(event.target).parent().css('top', '18%'); if (popUp.trackDescriptionOnly) { $(event.target).parent().css('left', '15%'); } else { $(event.target).parent().css('left', '30%'); } - var containerHeight = $(event.target).parent().height(); var offsetTop = $(event.target).parent()[0].offsetTop; // from popMaxHeight calculation above: var offsetBottom = 40; var maxContainerHeight = $(window).height() - offsetTop - offsetBottom; - if (containerHeight > maxContainerHeight) { - $(event.target).parent().css('height', maxContainerHeight); - // the 100 below accounts for the buttons, and label, there is - // probably a better way to get the exact size of the container - // with no content - $(event.target).css('height', maxContainerHeight - 100); - } + $(event.target).css('max-height', maxContainerHeight - 100); if (!popUp.trackDescriptionOnly) { $('#hgTrackUiDialog').find('.filterBy,.filterComp').each( function(i) { if ($(this).hasClass('filterComp')) ddcl.setup(this); else ddcl.setup(this, 'noneIsAll'); } ); } }, close: function() { popUp.cleanup(); }