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);
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
onUiLoaded(function() {
|
||||
var mutationObserver = new MutationObserver(function(m) {
|
||||
if (!executedAfterScripts &&
|
||||
gradioApp().querySelectorAll("[id$='_extra_search']").length >= 6) {
|
||||
let existingSearchfields = gradioApp().querySelectorAll("[id$='_extra_search']").length;
|
||||
let neededSearchfields = gradioApp().querySelectorAll("[id$='_extra_tabs'] > .tab-nav > button").length - 2;
|
||||
|
||||
if (!executedAfterScripts && existingSearchfields >= neededSearchfields) {
|
||||
mutationObserver.disconnect();
|
||||
executedAfterScripts = true;
|
||||
scheduleAfterScriptsCallbacks();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue