diff options
author | d8ahazard <d8ahazard@gmail.com> | 2022-09-27 16:02:41 +0000 |
---|---|---|
committer | d8ahazard <d8ahazard@gmail.com> | 2022-09-27 16:02:41 +0000 |
commit | 5756d517a6342d8a9ffa3ead636dcb84b463d2e3 (patch) | |
tree | 6feb5e799520b66aa65f09f7dbb352f4e3813a60 /script.js | |
parent | 11875f586323cea7c5b8398976449788a83dee76 (diff) | |
parent | ada901ed661a717c44281d640b8fc0a275d4cb48 (diff) | |
download | stable-diffusion-webui-gfx803-5756d517a6342d8a9ffa3ead636dcb84b463d2e3.tar.gz stable-diffusion-webui-gfx803-5756d517a6342d8a9ffa3ead636dcb84b463d2e3.tar.bz2 stable-diffusion-webui-gfx803-5756d517a6342d8a9ffa3ead636dcb84b463d2e3.zip |
Merge remote-tracking branch 'upstream/master' into ModelLoader
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 |