diff options
author | 48DESIGN <github@48design.de> | 2022-09-27 06:05:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-27 06:05:19 +0000 |
commit | e4145c84537b563a4b0ad7d225764f8c446479b5 (patch) | |
tree | 7a3aa1a9e22632eeb29bab969bd1cf61f8c9ca0f /script.js | |
parent | 2846ca57028cca1a9ce9cee66d2500b4ac38a9c6 (diff) | |
parent | c0b1177a3203091ca43f2d08f24dd821f1237612 (diff) | |
download | stable-diffusion-webui-gfx803-e4145c84537b563a4b0ad7d225764f8c446479b5.tar.gz stable-diffusion-webui-gfx803-e4145c84537b563a4b0ad7d225764f8c446479b5.tar.bz2 stable-diffusion-webui-gfx803-e4145c84537b563a4b0ad7d225764f8c446479b5.zip |
Merge branch 'master' into notification-sound
Diffstat (limited to 'script.js')
-rw-r--r-- | script.js | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -39,3 +39,24 @@ document.addEventListener("DOMContentLoaded", function() { }); mutationObserver.observe( gradioApp(), { childList:true, subtree:true }) }); + +/** + * checks that a UI element is not in another hidden element or tab content + */ +function uiElementIsVisible(el) { + let isVisible = !el.closest('.\\!hidden'); + if ( ! isVisible ) { + return false; + } + + while( isVisible = el.closest('.tabitem')?.style.display !== 'none' ) { + if ( ! isVisible ) { + return false; + } else if ( el.parentElement ) { + el = el.parentElement + } else { + break; + } + } + return isVisible; +}
\ No newline at end of file |