This commit is contained in:
Vanessa 2024-11-21 10:36:02 +08:00
parent dea6ecd5b9
commit 98a096551a
3 changed files with 11 additions and 11 deletions

View file

@ -588,7 +588,7 @@ const fileTreeKeydown = (app: App, event: KeyboardEvent) => {
if (item.getAttribute("data-type") === "navigation-file") { if (item.getAttribute("data-type") === "navigation-file") {
ids.push(item.getAttribute("data-node-id")); ids.push(item.getAttribute("data-node-id"));
} }
}) });
if (matchHotKey(window.siyuan.config.keymap.editor.general.spaceRepetition.custom, event) && !window.siyuan.config.readonly) { if (matchHotKey(window.siyuan.config.keymap.editor.general.spaceRepetition.custom, event) && !window.siyuan.config.readonly) {
if (isFile) { if (isFile) {
@ -663,7 +663,7 @@ const fileTreeKeydown = (app: App, event: KeyboardEvent) => {
fetchPost("/api/filetree/duplicateDoc", { fetchPost("/api/filetree/duplicateDoc", {
id: item, id: item,
}); });
}) });
return true; return true;
} }

View file

@ -244,4 +244,4 @@ export const copyTextByType = async (ids: string[],
} }
} }
writeText(text); writeText(text);
} };

View file

@ -55,9 +55,9 @@ export const commonHotkey = (protyle: IProtyle, event: KeyboardEvent, nodeElemen
if (selectElements.length === 0) { if (selectElements.length === 0) {
selectElements.push(nodeElement); selectElements.push(nodeElement);
} }
copyTextByType(selectElements.map(item => item.getAttribute("data-node-id")), "protocolMd") copyTextByType(selectElements.map(item => item.getAttribute("data-node-id")), "protocolMd");
} else { } else {
copyTextByType([protyle.block.rootID], "protocolMd") copyTextByType([protyle.block.rootID], "protocolMd");
} }
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
@ -70,9 +70,9 @@ export const commonHotkey = (protyle: IProtyle, event: KeyboardEvent, nodeElemen
if (selectElements.length === 0) { if (selectElements.length === 0) {
selectElements.push(nodeElement); selectElements.push(nodeElement);
} }
copyTextByType(selectElements.map(item => item.getAttribute("data-node-id")), "id") copyTextByType(selectElements.map(item => item.getAttribute("data-node-id")), "id");
} else { } else {
copyTextByType([protyle.block.rootID], "id") copyTextByType([protyle.block.rootID], "id");
} }
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
@ -84,9 +84,9 @@ export const commonHotkey = (protyle: IProtyle, event: KeyboardEvent, nodeElemen
if (selectElements.length === 0) { if (selectElements.length === 0) {
selectElements.push(nodeElement); selectElements.push(nodeElement);
} }
copyTextByType(selectElements.map(item => item.getAttribute("data-node-id")), "protocol") copyTextByType(selectElements.map(item => item.getAttribute("data-node-id")), "protocol");
} else { } else {
copyTextByType([protyle.block.rootID], "protocol") copyTextByType([protyle.block.rootID], "protocol");
} }
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
@ -99,9 +99,9 @@ export const commonHotkey = (protyle: IProtyle, event: KeyboardEvent, nodeElemen
if (selectElements.length === 0) { if (selectElements.length === 0) {
selectElements.push(nodeElement); selectElements.push(nodeElement);
} }
copyTextByType(selectElements.map(item => item.getAttribute("data-node-id")), "blockEmbed") copyTextByType(selectElements.map(item => item.getAttribute("data-node-id")), "blockEmbed");
} else { } else {
copyTextByType([protyle.block.rootID], "blockEmbed") copyTextByType([protyle.block.rootID], "blockEmbed");
} }
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();