mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-03-09 23:44:55 +08:00
change condition for scheduleAfterScriptsCallbacks() to properly reflect the needed amount of search fields
This commit is contained in:
parent
f293dbbf97
commit
2e1b61e590
@ -622,10 +622,13 @@ function scheduleAfterScriptsCallbacks() {
|
|||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
onUiLoaded(function() {
|
||||||
var mutationObserver = new MutationObserver(function(m) {
|
var mutationObserver = new MutationObserver(function(m) {
|
||||||
if (!executedAfterScripts &&
|
let existingSearchfields = gradioApp().querySelectorAll("[id$='_extra_search']").length;
|
||||||
gradioApp().querySelectorAll("[id$='_extra_search']").length >= 6) {
|
let neededSearchfields = gradioApp().querySelectorAll("[id$='_extra_tabs'] > .tab-nav > button").length - 2;
|
||||||
|
|
||||||
|
if (!executedAfterScripts && existingSearchfields >= neededSearchfields) {
|
||||||
|
mutationObserver.disconnect();
|
||||||
executedAfterScripts = true;
|
executedAfterScripts = true;
|
||||||
scheduleAfterScriptsCallbacks();
|
scheduleAfterScriptsCallbacks();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user