Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: fix https://github.com/siyuan-note/siyuan/issues/6119

Vanessaef614963cf12
diff --git a/app/src/layout/dock/Backlink.ts b/app/src/layout/dock/Backlink.ts
index caa1207bfd..288c036f8f 100644
--- a/app/src/layout/dock/Backlink.ts
+++ b/app/src/layout/dock/Backlink.ts
@@ -19,7 +19,7 @@ export class Backlink extends Model {
private tree: Tree;
private notebookId: string;
private mTree: Tree;
- private editors: Protyle[] = [];
+ public editors: Protyle[] = [];
public status: {
[key: string]: {
sort: string,
diff --git a/app/src/util/globalShortcut.ts b/app/src/util/globalShortcut.ts
index f6a291e79c..a7ebf8dde3 100644
--- a/app/src/util/globalShortcut.ts
+++ b/app/src/util/globalShortcut.ts
@@ -100,21 +100,39 @@ export const globalShortcut = () => {
if (!targetBlockElement) {
return;
}
- const hasTab = getAllModels().editor.find(item => {
+ const allModels = getAllModels()
+ let findNode = false
+ allModels.editor.find(item => {
if (item.editor.protyle.wysiwyg.element.isSameNode(eventPath0)) {
item.editor.protyle.gutter.render(targetBlockElement, item.editor.protyle.wysiwyg.element);
+ findNode = true
return true;
}
});
- if (!hasTab) {
+ if (!findNode) {
window.siyuan.blockPanels.find(item => {
- const hasEdit = item.editors.find(eItem => {
+ item.editors.find(eItem => {
if (eItem.protyle.wysiwyg.element.contains(eventPath0)) {
eItem.protyle.gutter.render(targetBlockElement, eItem.protyle.wysiwyg.element);
+ findNode = true;
return true;
}
});
- if (hasEdit) {
+ if (findNode) {
+ return true;
+ }
+ });
+ }
+ if (!findNode) {
+ allModels.backlink.find(item => {
+ item.editors.find(eItem => {
+ if (eItem.protyle.wysiwyg.element.isSameNode(eventPath0)) {
+ eItem.protyle.gutter.render(targetBlockElement, eItem.protyle.wysiwyg.element);
+ findNode = true
+ return true;
+ }
+ });
+ if (findNode) {
return true;
}
});
@@ -128,21 +146,39 @@ export const globalShortcut = () => {
if (!targetBlockElement) {
return;
}
- const hasTab = getAllModels().editor.find(item => {
+ const allModels = getAllModels();
+ let findNode = false;
+ allModels.editor.find(item => {
if (item.editor.protyle.wysiwyg.element.contains(eventPath0)) {
item.editor.protyle.gutter.render(targetBlockElement, item.editor.protyle.wysiwyg.element);
+ findNode = true
return true;
}
});
- if (!hasTab) {
+ if (!findNode) {
window.siyuan.blockPanels.find(item => {
- const hasEdit = item.editors.find(eItem => {
+ item.editors.find(eItem => {
+ if (eItem.protyle.wysiwyg.element.contains(eventPath0)) {
+ eItem.protyle.gutter.render(targetBlockElement, eItem.protyle.wysiwyg.element);
+ findNode = true;
+ return true;
+ }
+ });
+ if (findNode) {
+ return true;
+ }
+ });
+ }
+ if (!findNode) {
+ allModels.backlink.find(item => {
+ item.editors.find(eItem => {
if (eItem.protyle.wysiwyg.element.contains(eventPath0)) {
eItem.protyle.gutter.render(targetBlockElement, eItem.protyle.wysiwyg.element);
+ findNode = true
return true;
}
});
- if (hasEdit) {
+ if (findNode) {
return true;
}
});