diff options
author | Aarni Koskela <akx@iki.fi> | 2023-05-30 14:50:09 +0000 |
---|---|---|
committer | Aarni Koskela <akx@iki.fi> | 2023-05-30 14:54:29 +0000 |
commit | f81931c591d4513420a0998bbf1591e35a92d14e (patch) | |
tree | 1fbae50edbeaccc710ff3a48de37f60c868d0fd5 /script.js | |
parent | b957dcfece29c84ac0cfcd5a69475ff8684c531f (diff) | |
download | stable-diffusion-webui-gfx803-f81931c591d4513420a0998bbf1591e35a92d14e.tar.gz stable-diffusion-webui-gfx803-f81931c591d4513420a0998bbf1591e35a92d14e.tar.bz2 stable-diffusion-webui-gfx803-f81931c591d4513420a0998bbf1591e35a92d14e.zip |
Frontend: only look at top-level tabs, not nested tabs
Refs https://github.com/adieyal/sd-dynamic-prompts/issues/459#issuecomment-1568543926
Diffstat (limited to 'script.js')
-rw-r--r-- | script.js | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -10,12 +10,18 @@ function gradioApp() { return elem.shadowRoot ? elem.shadowRoot : elem; } +/** + * Get the currently selected top-level UI tab button (e.g. the button that says "Extras"). + */ function get_uiCurrentTab() { - return gradioApp().querySelector('#tabs button.selected'); + return gradioApp().querySelector('#tabs > .tab-nav > button.selected'); } +/** + * Get the first currently visible top-level UI tab content (e.g. the div hosting the "txt2img" UI). + */ function get_uiCurrentTabContent() { - return gradioApp().querySelector('.tabitem[id^=tab_]:not([style*="display: none"])'); + return gradioApp().querySelector('#tabs > .tabitem[id^=tab_]:not([style*="display: none"])'); } var uiUpdateCallbacks = []; |