mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-14 19:18:06 +01:00
This commit is contained in:
parent
0ba7a47472
commit
1b3173d6f4
2 changed files with 8 additions and 7 deletions
|
|
@ -504,13 +504,13 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
|
|||
event.preventDefault();
|
||||
return true;
|
||||
}
|
||||
if (!isFileFocus && matchHotKey(window.siyuan.config.keymap.editor.general.copyBlockRef.custom, event)) {
|
||||
if (range && !isFileFocus && matchHotKey(window.siyuan.config.keymap.editor.general.copyBlockRef.custom, event)) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
if (hasClosestByClassName(range?.startContainer, "protyle-title")) {
|
||||
if (hasClosestByClassName(range.startContainer, "protyle-title")) {
|
||||
copyTextByType([protyle.block.rootID], "ref");
|
||||
} else {
|
||||
const nodeElement = hasClosestBlock(range?.startContainer);
|
||||
const nodeElement = hasClosestBlock(range.startContainer);
|
||||
if (!nodeElement) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -519,9 +519,9 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
|
|||
copyPNGByLink(selectImgElement.querySelector("img").getAttribute("src"));
|
||||
return true;
|
||||
}
|
||||
const selectBlocks = protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select");
|
||||
if (selectBlocks.length !== 0) {
|
||||
copyTextByType(Array.from(selectBlocks).map(item => item.getAttribute("data-node-id")), "ref");
|
||||
const ids = Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select")).map(item => item.getAttribute("data-node-id"));
|
||||
if (ids.length > 0) {
|
||||
copyTextByType(ids, "ref");
|
||||
return true;
|
||||
}
|
||||
if (range.toString() !== "") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue