optimization for extra networks filtering

This commit is contained in:
AUTOMATIC1111 2024-03-08 16:54:39 +03:00
parent a551a43164
commit 3bd75adb1c
1 changed files with 4 additions and 2 deletions

View File

@ -106,7 +106,9 @@ function setupExtraNetworksForTab(tabname) {
}); });
}; };
search.addEventListener("input", applyFilter); search.addEventListener("input", function() {
applyFilter();
});
applySort(); applySort();
applyFilter(); applyFilter();
extraNetworksApplySort[tabname_full] = applySort; extraNetworksApplySort[tabname_full] = applySort;
@ -458,7 +460,7 @@ function extraNetworksControlTreeViewOnClick(event, tabname, extra_networks_tabn
*/ */
var button = event.currentTarget; var button = event.currentTarget;
button.classList.toggle("extra-network-control--enabled"); button.classList.toggle("extra-network-control--enabled");
var show = ! button.classList.contains("extra-network-control--enabled"); var show = !button.classList.contains("extra-network-control--enabled");
var pane = gradioApp().getElementById(tabname + "_" + extra_networks_tabname + "_pane"); var pane = gradioApp().getElementById(tabname + "_" + extra_networks_tabname + "_pane");
pane.classList.toggle("extra-network-dirs-hidden", show); pane.classList.toggle("extra-network-dirs-hidden", show);