diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-05-31 16:34:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-31 16:34:59 +0000 |
commit | 726f3feb2b69a45c2e791dfb23eb26410f1966c9 (patch) | |
tree | 003c166b4607d8e5a666370fd43966567d51f4d4 | |
parent | e72013ea6761514dc75469e511343becae61aebe (diff) | |
parent | f81931c591d4513420a0998bbf1591e35a92d14e (diff) | |
download | stable-diffusion-webui-gfx803-726f3feb2b69a45c2e791dfb23eb26410f1966c9.tar.gz stable-diffusion-webui-gfx803-726f3feb2b69a45c2e791dfb23eb26410f1966c9.tar.bz2 stable-diffusion-webui-gfx803-726f3feb2b69a45c2e791dfb23eb26410f1966c9.zip |
Merge pull request #10863 from akx/ui-current-tab-top-level
Frontend: only look at top-level tabs, not nested tabs
-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 = []; |