Skip to content

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

:art: 反链面板块标打开

Vanessa8bd4056a0e77
diff --git a/app/src/boot/globalEvent/command/protyle.ts b/app/src/boot/globalEvent/command/protyle.ts
index a20e9b4f7a..919e400fd0 100644
--- a/app/src/boot/globalEvent/command/protyle.ts
+++ b/app/src/boot/globalEvent/command/protyle.ts
@@ -1,8 +1,10 @@
import {hasClosestBlock} from "../../../protyle/util/hasClosest";
import {getTopAloneElement} from "../../../protyle/wysiwyg/getBlock";
import {enterBack, zoomOut} from "../../../menus/protyle";
+/// #if !MOBILE
import {openFileById} from "../../../editor/util";
-import {Constants} from "../../../constants";
+/// #endif
+import {checkFold} from "../../../util/noRelyPCFunction";
export const onlyProtyleCommand = (options: {
command: string,
@@ -21,11 +23,16 @@ export const onlyProtyleCommand = (options: {
}
const id = topNodeElement.getAttribute("data-node-id");
if (options.protyle.options.backlinkData) {
- openFileById({
- app: options.protyle.app,
- id,
- action: [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS]
+ /// #if !MOBILE
+ checkFold(id, (zoomIn, action) => {
+ openFileById({
+ app: options.protyle.app,
+ id,
+ action,
+ zoomIn
+ });
});
+ /// #endif
} else {
zoomOut({protyle: options.protyle, id});
}
diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts
index a4a8f0fde8..439a9e62a3 100644
--- a/app/src/protyle/gutter/index.ts
+++ b/app/src/protyle/gutter/index.ts
@@ -60,7 +60,10 @@ import {avContextmenu, duplicateCompletely} from "../render/av/action";
import {getPlainText} from "../util/paste";
import {addEditorToDatabase} from "../render/av/addToDatabase";
import {processClonePHElement} from "../render/util";
+/// #if !MOBILE
import {openFileById} from "../../editor/util";
+/// #endif
+import {checkFold} from "../../util/noRelyPCFunction";
export class Gutter {
public element: HTMLElement;
@@ -1708,18 +1711,23 @@ export class Gutter {
}
}).element);
} else {
+ /// #if !MOBILE
window.siyuan.menus.menu.append(new MenuItem({
id: "enter",
accelerator: `${updateHotkeyTip(window.siyuan.config.keymap.general.enter.custom)}/${updateHotkeyTip("⌘" + window.siyuan.languages.click)}`,
label: window.siyuan.languages.openBy,
click: () => {
- openFileById({
- app: protyle.app,
- id,
- action: [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS]
+ checkFold(id, (zoomIn, action) => {
+ openFileById({
+ app: protyle.app,
+ id,
+ action,
+ zoomIn
+ });
});
}
}).element);
+ /// #endif
}
if (!protyle.disabled) {
window.siyuan.menus.menu.append(new MenuItem({