resize handle for extra networks

This commit is contained in:
Andray
2024-02-27 18:31:36 +04:00
parent c8a5322d1f
commit 44bce3c74e
6 changed files with 51 additions and 9 deletions

View File

@@ -447,7 +447,24 @@ function extraNetworksControlTreeViewOnClick(event, tabname, extra_networks_tabn
* @param tabname The name of the active tab in the sd webui. Ex: txt2img, img2img, etc.
* @param extra_networks_tabname The id of the active extraNetworks tab. Ex: lora, checkpoints, etc.
*/
gradioApp().getElementById(tabname + "_" + extra_networks_tabname + "_tree").classList.toggle("hidden");
const tree = gradioApp().getElementById(tabname + "_" + extra_networks_tabname + "_tree");
const parent = tree.parentElement;
let resizeHandle = parent.querySelector('.resize-handle');
tree.classList.toggle("hidden");
if (tree.classList.contains("hidden")){
tree.style.display = 'none';
resizeHandle.style.display = 'none';
parent.style.display = 'flex';
} else {
tree.style.display = 'block';
if (!resizeHandle) {
setupResizeHandle(parent);
resizeHandle = parent.querySelector('.resize-handle');
}
resizeHandle.style.display = 'block';
parent.style.display = 'grid';
}
event.currentTarget.classList.toggle("extra-network-control--enabled");
}