From 8bd4056a0e77e633e2a5dfe62af2f65b93fb3c71 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 4 Nov 2024 17:22:15 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E5=8F=8D=E9=93=BE=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E5=9D=97=E6=A0=87=E6=89=93=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/boot/globalEvent/command/protyle.ts | 17 ++++++++++++----- app/src/protyle/gutter/index.ts | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/app/src/boot/globalEvent/command/protyle.ts b/app/src/boot/globalEvent/command/protyle.ts index a20e9b4f7..919e400fd 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 a4a8f0fde..439a9e62a 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({