Fix Unable to filter additional networks by subfolder #49

This commit is contained in:
anapnoe
2023-04-10 06:41:32 +03:00
parent 3d457a06be
commit 68c593da82
2 changed files with 3 additions and 4 deletions
+2 -3
View File
@@ -14,8 +14,8 @@ function setupExtraNetworksForTab(tabname){
searchTerm = search.value.toLowerCase()
gradioApp().querySelectorAll('#'+tabname+'_extra_tabs div.card').forEach(function(elem){
text = elem.querySelector('.name').textContent.toLowerCase() + " " + elem.querySelector('.search_term').textContent.toLowerCase()
elem.style.display = text.indexOf(searchTerm) == -1 ? "none" : ""
text = elem.querySelector('.name').textContent.toLowerCase() + " " + elem.querySelector('.search_term').textContent.toLowerCase();
elem.parentElement.style.display = text.indexOf(searchTerm) == -1 ? "none" : "";
})
});
}
@@ -99,7 +99,6 @@ function extraNetworksSearchButton(tabs_id, event){
searchTextarea = gradioApp().querySelector("#" + tabs_id + ' > div > textarea')
button = event.target
text = button.classList.contains("search-all") ? "" : button.textContent.trim()
searchTextarea.value = text
updateInput(searchTextarea)
}