diff --git a/app/src/protyle/header/Title.ts b/app/src/protyle/header/Title.ts index 21d0561c8..323078352 100644 --- a/app/src/protyle/header/Title.ts +++ b/app/src/protyle/header/Title.ts @@ -20,7 +20,7 @@ import {matchHotKey} from "../util/hotKey"; import {readText, updateHotkeyTip, writeText} from "../util/compatibility"; import * as dayjs from "dayjs"; import {setPanelFocus} from "../../layout/util"; -import {updatePanelByEditor} from "../../editor/util"; +import {openFileById, updatePanelByEditor} from "../../editor/util"; import {openBacklink, openGraph, openOutline} from "../../layout/dock/util"; import {setTitle} from "../../dialog/processSystem"; import {getNoContainerElement} from "../wysiwyg/getBlock"; @@ -86,7 +86,18 @@ export class Title { if (commonHotkey(protyle, event)) { return true; } - + if (matchHotKey(window.siyuan.config.keymap.general.enterBack.custom, event)) { + const ids = protyle.path.split("/"); + if (ids.length > 2) { + openFileById({ + id: ids[ids.length - 2], + action: [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL] + }); + } + event.preventDefault(); + event.stopPropagation(); + return; + } /// #if !BROWSER if (matchHotKey(window.siyuan.config.keymap.editor.general.undo.custom, event)) { getCurrentWindow().webContents.undo(); diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts index 8c299e75d..4e92741e2 100644 --- a/app/src/protyle/wysiwyg/keydown.ts +++ b/app/src/protyle/wysiwyg/keydown.ts @@ -441,14 +441,10 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { if (!protyle.block.showAll) { const ids = protyle.path.split("/"); if (ids.length > 2) { - /// #if MOBILE - openMobileFileById(ids[ids.length - 2], [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL]); - /// #else openFileById({ id: ids[ids.length - 2], action: [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL] }); - /// #endif } } else { zoomOut(protyle, protyle.block.parent2ID, nodeElement.getAttribute("data-node-id"));