From 993da0a6804a42a12f06d15b8582ecaedcd2431b Mon Sep 17 00:00:00 2001 From: Alex Heller Date: Sun, 4 Jun 2023 17:46:15 +0200 Subject: [PATCH] Some cleanup on the frontend side --- javascript/ui.js | 9 +-------- style.css | 3 ++- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/javascript/ui.js b/javascript/ui.js index 3647864b3..4d8b00faa 100644 --- a/javascript/ui.js +++ b/javascript/ui.js @@ -261,8 +261,7 @@ onUiLoaded(function(){ tab_nav_buttons = gradioApp().querySelectorAll('#settings > .tab-nav > button') tab_elements = gradioApp().querySelectorAll('#settings > div:not(.tab-nav)') - // Add mutation observer to to all tab items - // HACK to keep gradio from closing when showing all pages + // HACK Add mutation observer to keep gradio from closing setting tabs when showing all pages const observer = new MutationObserver(function(mutations) { const show_all_pages_dummy = gradioApp().getElementById('settings_show_all_pages') if (show_all_pages_dummy.style.display == "none") @@ -287,8 +286,6 @@ onUiLoaded(function(){ new_indicator.className = "modification-indicator" new_indicator.disabled = true new_indicator.onclick = () => onSettingsModificationIndicatorClicked(elem.id) - - // Add a modification indicator to the toplevel tab button tab_nav_element.insertBefore(new_indicator, tab_nav_buttons[index]) // Add the tab content to the wrapper @@ -297,10 +294,6 @@ onUiLoaded(function(){ // Add the mutation observer to the tab element observer.observe(elem, { attributes: true, attributeFilter: ['style'] }) }) - - - // Add the dirtyable class to the tab nav element - tab_nav_element.classList.add('dirtyable') }) diff --git a/style.css b/style.css index cef5afdda..bfd2c229b 100644 --- a/style.css +++ b/style.css @@ -237,7 +237,8 @@ div#extras_scale_to_tab div.form{ grid-template-columns: repeat(auto-fill, .3em minmax(10em, 1fr)); flex: 1 0 auto; width: 11em; - align-self: flex-start + align-self: flex-start; + gap: var(--spacing-md); } #settings > div.tab-nav button{