diff options
author | Liam <liamthekerr@gmail.com> | 2022-09-27 20:37:24 +0000 |
---|---|---|
committer | Liam <liamthekerr@gmail.com> | 2022-09-27 20:37:24 +0000 |
commit | 981fe9c4a3994bb42ea5ff5212e4fe53b748bdd9 (patch) | |
tree | 80fd53962ccafeb773b2d43b178e1ee39ac03ca3 /script.js | |
parent | 5034f7d7597685aaa4779296983be0f49f4f991f (diff) | |
parent | f2a4a2c3a672e22f088a7455d6039557370dd3f2 (diff) | |
download | stable-diffusion-webui-gfx803-981fe9c4a3994bb42ea5ff5212e4fe53b748bdd9.tar.gz stable-diffusion-webui-gfx803-981fe9c4a3994bb42ea5ff5212e4fe53b748bdd9.tar.bz2 stable-diffusion-webui-gfx803-981fe9c4a3994bb42ea5ff5212e4fe53b748bdd9.zip |
Merge remote-tracking branch 'upstream/master' into token_count
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 |