This commit is contained in:
Vanessa 2023-04-21 20:09:52 +08:00
parent 2230d12fbb
commit bec5fbc9cb
2 changed files with 13 additions and 6 deletions

View file

@ -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();

View file

@ -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"));