Vanessa 2025-09-03 11:41:55 +08:00
parent 2738b9adb0
commit 125d18a0e1
2 changed files with 14 additions and 3 deletions

View file

@ -67,10 +67,14 @@ export const viewCards = (app: App, deckID: string, title: string, deckType: "Tr
if (response.data.blocks.length > 0) {
edit = new Protyle(app, dialog.element.querySelector("#cardPreview") as HTMLElement, {
blockId: "",
action: [Constants.CB_GET_ALL],
render: {
gutter: true,
breadcrumbDocName: true
breadcrumbDocName: true,
title: true,
hideTitleOnZoom: true,
},
typewriterMode: false
});
if (window.siyuan.mobile) {
window.siyuan.mobile.popEditor = edit;
@ -310,6 +314,10 @@ const getArticle = (edit: Protyle, id: string) => {
data: getResponse,
protyle: edit.protyle,
action: getResponse.data.rootID === getResponse.data.id ? [Constants.CB_GET_HTML] : [Constants.CB_GET_ALL, Constants.CB_GET_HTML],
afterCB() {
edit.protyle.title.element.removeAttribute("data-render");
edit.protyle.title.render(edit.protyle, response);
}
});
});
});

View file

@ -24,6 +24,7 @@ import {transferBlockRef} from "../../menus/block";
import {addEditorToDatabase} from "../render/av/addToDatabase";
import {openFileById} from "../../editor/util";
import {hasTopClosestByClassName} from "../util/hasClosest";
import {openMobileFileById} from "../../mobile/editor";
export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
hideTooltip();
@ -214,22 +215,24 @@ export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
transferBlockRef(protyle.block.rootID);
}
window.siyuan.menus.menu.append(new MenuItem({id: "separator_3", type: "separator"}).element);
/// #if !MOBILE
if (!protyle.model) {
window.siyuan.menus.menu.append(new MenuItem({
id: "openBy",
label: window.siyuan.languages.openBy,
icon: "iconOpen",
click() {
/// #if !MOBILE
openFileById({
app: protyle.app,
id: protyle.block.id,
action: protyle.block.rootID !== protyle.block.id ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_CONTEXT],
});
/// #else
openMobileFileById(protyle.app, protyle.block.id, protyle.block.rootID !== protyle.block.id ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_CONTEXT]);
/// #endif
}
}).element);
}
/// #endif
/// #if !BROWSER
window.siyuan.menus.menu.append(new MenuItem({
id: "openByNewWindow",