🎨 反链面板块标打开

This commit is contained in:
Vanessa 2024-11-04 17:22:15 +08:00
parent 358fedbbd9
commit 8bd4056a0e
2 changed files with 24 additions and 9 deletions

View file

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

View file

@ -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({