This commit is contained in:
Vanessa 2023-04-14 23:03:14 +08:00
parent 2ee6b54bc7
commit 1ad395ceec

View file

@ -191,13 +191,13 @@ export class Files extends Model {
let target = event.target as HTMLElement;
while (target && !target.isEqualNode(this.element)) {
if (target.tagName === "LI" && !target.getAttribute("data-opening")) {
target.setAttribute("data-opening", "true")
target.setAttribute("data-opening", "true");
openFileById({
removeCurrentTab: false,
id: target.getAttribute("data-node-id"),
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL],
afterOpen() {
target.removeAttribute("data-opening")
target.removeAttribute("data-opening");
}
});
event.stopPropagation();
@ -257,7 +257,7 @@ export class Files extends Model {
if (target.getAttribute("data-type") === "navigation-file") {
needFocus = false;
if (target.getAttribute("data-opening")) {
return
return;
}
target.setAttribute("data-opening", "true");
if (event.altKey && !event.metaKey && !event.ctrlKey && !event.shiftKey) {
@ -266,7 +266,7 @@ export class Files extends Model {
position: "right",
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL],
afterOpen() {
target.removeAttribute("data-opening")
target.removeAttribute("data-opening");
}
});
} else if (!event.altKey && !event.metaKey && !event.ctrlKey && event.shiftKey) {
@ -275,7 +275,7 @@ export class Files extends Model {
position: "bottom",
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL],
afterOpen() {
target.removeAttribute("data-opening")
target.removeAttribute("data-opening");
}
});
} else if (window.siyuan.config.fileTree.openFilesUseCurrentTab &&
@ -285,7 +285,7 @@ export class Files extends Model {
id: target.getAttribute("data-node-id"),
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL],
afterOpen() {
target.removeAttribute("data-opening")
target.removeAttribute("data-opening");
}
});
} else {
@ -293,7 +293,7 @@ export class Files extends Model {
id: target.getAttribute("data-node-id"),
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL],
afterOpen() {
target.removeAttribute("data-opening")
target.removeAttribute("data-opening");
}
});
}