From d7321cccece1908cfab38a1e2c082deb52893951 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 28 Oct 2022 11:46:44 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/6387 --- app/src/editor/util.ts | 4 +++- app/src/protyle/wysiwyg/index.ts | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/src/editor/util.ts b/app/src/editor/util.ts index bf5da8615..f3b86ec89 100644 --- a/app/src/editor/util.ts +++ b/app/src/editor/util.ts @@ -348,7 +348,9 @@ export const isCurrentEditor = (blockId: string) => { if (activeElement) { const tab = getInstanceById(activeElement.getAttribute("data-id")); if (tab instanceof Tab && tab.model instanceof Editor) { - if (tab.model.editor.protyle.block.rootID !== blockId && tab.model.editor.protyle.block.id !== blockId) { + if (tab.model.editor.protyle.block.rootID !== blockId && + tab.model.editor.protyle.block.parentID !== blockId && // updateBacklinkGraph 时会传入 parentID + tab.model.editor.protyle.block.id !== blockId) { return false; } } diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 14113a331..3d5758e69 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -1407,8 +1407,13 @@ export class WYSIWYG { hideElements(["hint", "util"], protyle); const backlinkBreadcrumbItemElement = hasClosestByClassName(event.target, "protyle-breadcrumb__item"); if (backlinkBreadcrumbItemElement) { - if (backlinkBreadcrumbItemElement.getAttribute("data-id")) { - loadBreadcrumb(protyle, backlinkBreadcrumbItemElement); + const breadcrumbId = backlinkBreadcrumbItemElement.getAttribute("data-id") + if (breadcrumbId) { + if (window.siyuan.ctrlIsPressed) { + openFileById({id: breadcrumbId, action: [Constants.CB_GET_FOCUS]}); + } else { + loadBreadcrumb(protyle, backlinkBreadcrumbItemElement); + } } else { // 引用标题时的更多加载 getBacklinkHeadingMore(backlinkBreadcrumbItemElement);