mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-09 06:02:33 +01:00
This commit is contained in:
parent
f9bbdcafbf
commit
fe87dc2170
2 changed files with 24 additions and 3 deletions
|
|
@ -27,6 +27,7 @@ import {confirmDialog} from "../../dialog/confirmDialog";
|
||||||
import {enableProtyle} from "../util/onGet";
|
import {enableProtyle} from "../util/onGet";
|
||||||
import {countBlockWord} from "../../layout/status";
|
import {countBlockWord} from "../../layout/status";
|
||||||
import {Constants} from "../../constants";
|
import {Constants} from "../../constants";
|
||||||
|
import {openFileById} from "../../editor/util";
|
||||||
|
|
||||||
export class Gutter {
|
export class Gutter {
|
||||||
public element: HTMLElement;
|
public element: HTMLElement;
|
||||||
|
|
@ -1180,7 +1181,17 @@ export class Gutter {
|
||||||
accelerator: window.siyuan.config.keymap.general.enterBack.custom,
|
accelerator: window.siyuan.config.keymap.general.enterBack.custom,
|
||||||
label: window.siyuan.languages.enterBack,
|
label: window.siyuan.languages.enterBack,
|
||||||
click() {
|
click() {
|
||||||
zoomOut(protyle, protyle.block.parent2ID, id);
|
if (!protyle.block.showAll) {
|
||||||
|
const ids = protyle.path.split("/");
|
||||||
|
if (ids.length > 2) {
|
||||||
|
openFileById({
|
||||||
|
id: ids[ids.length - 2],
|
||||||
|
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
zoomOut(protyle, protyle.block.parent2ID, id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
if (!window.siyuan.config.readonly) {
|
if (!window.siyuan.config.readonly) {
|
||||||
|
|
|
||||||
|
|
@ -408,7 +408,17 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matchHotKey(window.siyuan.config.keymap.general.enterBack.custom, event)) {
|
if (matchHotKey(window.siyuan.config.keymap.general.enterBack.custom, event)) {
|
||||||
zoomOut(protyle, protyle.block.parent2ID, nodeElement.getAttribute("data-node-id"));
|
if (!protyle.block.showAll) {
|
||||||
|
const ids = protyle.path.split("/");
|
||||||
|
if (ids.length > 2) {
|
||||||
|
openFileById({
|
||||||
|
id: ids[ids.length - 2],
|
||||||
|
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
zoomOut(protyle, protyle.block.parent2ID, nodeElement.getAttribute("data-node-id"));
|
||||||
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
return;
|
return;
|
||||||
|
|
@ -1639,7 +1649,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
return true;
|
return true;
|
||||||
}else if (matchHotKey(window.siyuan.config.keymap.editor.general.refPopover.custom, event)) {
|
} else if (matchHotKey(window.siyuan.config.keymap.editor.general.refPopover.custom, event)) {
|
||||||
// open popover
|
// open popover
|
||||||
window.siyuan.blockPanels.push(new BlockPanel({
|
window.siyuan.blockPanels.push(new BlockPanel({
|
||||||
targetElement: refElement,
|
targetElement: refElement,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue