mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-03 10:50:23 +00:00
refactored image paste handling to fill unset images successively, then replace last existing image (fixes #981)
This commit is contained in:
21
script.js
21
script.js
@@ -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;
|
||||
}
|
Reference in New Issue
Block a user