This commit is contained in:
Vanessa 2022-11-08 21:58:24 +08:00
parent 6a143c699f
commit f1c20abc88

View File

@ -250,13 +250,12 @@ export class Files extends Model {
event.stopPropagation(); event.stopPropagation();
break; break;
} else if (target.tagName === "LI") { } else if (target.tagName === "LI") {
needFocus = false;
if ((event.metaKey || event.ctrlKey) && !event.altKey && !event.shiftKey) { if ((event.metaKey || event.ctrlKey) && !event.altKey && !event.shiftKey) {
setPanelFocus(this.element.parentElement);
target.classList.toggle("b3-list-item--focus"); target.classList.toggle("b3-list-item--focus");
} else { } else {
this.setCurrent(target, false); this.setCurrent(target, false);
if (target.getAttribute("data-type") === "navigation-file") { if (target.getAttribute("data-type") === "navigation-file") {
needFocus = false;
if (event.altKey && !event.metaKey && !event.ctrlKey && !event.shiftKey) { if (event.altKey && !event.metaKey && !event.ctrlKey && !event.shiftKey) {
openFileById({ openFileById({
id: target.getAttribute("data-node-id"), id: target.getAttribute("data-node-id"),
@ -284,7 +283,6 @@ export class Files extends Model {
} }
} else if (target.getAttribute("data-type") === "navigation-root") { } else if (target.getAttribute("data-type") === "navigation-root") {
this.getLeaf(target, notebookId); this.getLeaf(target, notebookId);
setPanelFocus(this.element.parentElement);
} }
} }
this.element.querySelector('[select-end="true"]')?.removeAttribute("select-end"); this.element.querySelector('[select-end="true"]')?.removeAttribute("select-end");