From b5271fb9f8c9f9f926e5b9006f82abff47e08fd6 Mon Sep 17 00:00:00 2001 From: Sj-Si Date: Tue, 23 Apr 2024 10:55:58 -0400 Subject: [PATCH] Fix bug --- javascript/extraNetworks.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/javascript/extraNetworks.js b/javascript/extraNetworks.js index ab51dda79..37a1de80e 100644 --- a/javascript/extraNetworks.js +++ b/javascript/extraNetworks.js @@ -1012,22 +1012,24 @@ function extraNetworksTreeFileOnClick(event, btn, tabname_full) { } async function extraNetworksTreeDirectoryOnClick(event, btn, tabname_full) { - const true_targ = event.target; const div_id = btn.dataset.divId; const tab = extra_networks_tabs[tabname_full]; - if (true_targ.matches(".tree-list-item-action--leading .tree-list-item-action-chevron")) { + if (event.target.matches(".tree-list-item-action--leading .tree-list-item-action-chevron")) { // If user clicks on the chevron, then we do not select the folder. await tab.tree_list.onRowExpandClick(div_id, btn); - } else if (true_targ.matches(".tree-list-item-action--trailing .tree-list-item-action-expand")) { + tab.setDirectoryButtons(); + return; + } else if (event.target.matches(".tree-list-item-action--trailing .tree-list-item-action-expand")) { await tab.tree_list.onExpandAllClick(div_id); - } else if (true_targ.matches(".tree-list-item-action--trailing .tree-list-item-action-collapse")) { + } else if (event.target.matches(".tree-list-item-action--trailing .tree-list-item-action-collapse")) { await tab.tree_list.onCollapseAllClick(div_id); } else { // user clicked anywhere else on the row await tab.tree_list.onRowSelected(div_id, btn); } + tab.setDirectoryButtons(btn); }