Added missing long press event for tree file items to enable the detail view.

This commit is contained in:
Sj-Si 2024-05-29 16:06:33 -04:00
parent 25e516a1d3
commit e4be1d5aaf

View File

@ -1477,16 +1477,18 @@ function extraNetworksCardOnLongPress(event) {
tab.showDetsView(btn); tab.showDetsView(btn);
} }
function extraNetworksTreeFileOnClick(event) { function extraNetworksTreeFileOnLongPress(event) {
// Do not select the row if its child button-row is the target of the event. const btn = event.target.closest(".tree-list-item--file");
if (event.target.closest(".tree-list-item-action")) {
return;
}
const btn = event.target.closest(".tree-list-item");
const pane = btn.closest(".extra-network-pane"); const pane = btn.closest(".extra-network-pane");
const tab = extra_networks_tabs[pane.dataset.tabnameFull]; const tab = extra_networks_tabs[pane.dataset.tabnameFull];
tab.showDetsView(btn);
}
function extraNetworksTreeFileOnClick(event) {
const btn = event.target.closest(".tree-list-item");
const pane = btn.closest(".extra-network-pane");
const tab = extra_networks_tabs[pane.dataset.tabnameFull];
let checkpoint_name; let checkpoint_name;
if ("isCheckpoint" in btn.dataset) { if ("isCheckpoint" in btn.dataset) {
@ -1752,7 +1754,6 @@ function extraNetworksSetupEventDelegators() {
}, event_options); }, event_options);
const click_event_map = { const click_event_map = {
".tree-list-item--file": extraNetworksTreeFileOnClick,
".copy-path-button": extraNetworksBtnCopyPathOnClick, ".copy-path-button": extraNetworksBtnCopyPathOnClick,
".edit-button": extraNetworksBtnEditMetadataOnClick, ".edit-button": extraNetworksBtnEditMetadataOnClick,
".metadata-button": extraNetworksBtnShowMetadataOnClick, ".metadata-button": extraNetworksBtnShowMetadataOnClick,
@ -1791,6 +1792,11 @@ function extraNetworksSetupEventDelegators() {
negative: ".tree-list-item-action", negative: ".tree-list-item-action",
handler: extraNetworksTreeDirectoryOnClick, handler: extraNetworksTreeDirectoryOnClick,
}, },
{
selector: ".tree-list-item--file",
negative: ".tree-list-item-action",
handler: extraNetworksTreeFileOnClick,
},
{ {
selector: ".extra-network-dirs-view-button", selector: ".extra-network-dirs-view-button",
handler: extraNetworksBtnDirsViewItemOnClick, handler: extraNetworksBtnDirsViewItemOnClick,
@ -1839,6 +1845,11 @@ function extraNetworksSetupEventDelegators() {
negative: ".tree-list-item-action", negative: ".tree-list-item-action",
handler: extraNetworksTreeDirectoryOnLongPress, handler: extraNetworksTreeDirectoryOnLongPress,
}, },
{
selector: ".tree-list-item--file",
negative: ".tree-list-item-action",
handler: extraNetworksTreeFileOnLongPress,
},
{ {
selector: ".extra-network-dirs-view-button", selector: ".extra-network-dirs-view-button",
handler: extraNetworksBtnDirsViewItemOnLongPress, handler: extraNetworksBtnDirsViewItemOnLongPress,