mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
This commit is contained in:
parent
2738b9adb0
commit
125d18a0e1
2 changed files with 14 additions and 3 deletions
|
|
@ -67,10 +67,14 @@ export const viewCards = (app: App, deckID: string, title: string, deckType: "Tr
|
||||||
if (response.data.blocks.length > 0) {
|
if (response.data.blocks.length > 0) {
|
||||||
edit = new Protyle(app, dialog.element.querySelector("#cardPreview") as HTMLElement, {
|
edit = new Protyle(app, dialog.element.querySelector("#cardPreview") as HTMLElement, {
|
||||||
blockId: "",
|
blockId: "",
|
||||||
|
action: [Constants.CB_GET_ALL],
|
||||||
render: {
|
render: {
|
||||||
gutter: true,
|
gutter: true,
|
||||||
breadcrumbDocName: true
|
breadcrumbDocName: true,
|
||||||
|
title: true,
|
||||||
|
hideTitleOnZoom: true,
|
||||||
},
|
},
|
||||||
|
typewriterMode: false
|
||||||
});
|
});
|
||||||
if (window.siyuan.mobile) {
|
if (window.siyuan.mobile) {
|
||||||
window.siyuan.mobile.popEditor = edit;
|
window.siyuan.mobile.popEditor = edit;
|
||||||
|
|
@ -310,6 +314,10 @@ const getArticle = (edit: Protyle, id: string) => {
|
||||||
data: getResponse,
|
data: getResponse,
|
||||||
protyle: edit.protyle,
|
protyle: edit.protyle,
|
||||||
action: getResponse.data.rootID === getResponse.data.id ? [Constants.CB_GET_HTML] : [Constants.CB_GET_ALL, Constants.CB_GET_HTML],
|
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);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ import {transferBlockRef} from "../../menus/block";
|
||||||
import {addEditorToDatabase} from "../render/av/addToDatabase";
|
import {addEditorToDatabase} from "../render/av/addToDatabase";
|
||||||
import {openFileById} from "../../editor/util";
|
import {openFileById} from "../../editor/util";
|
||||||
import {hasTopClosestByClassName} from "../util/hasClosest";
|
import {hasTopClosestByClassName} from "../util/hasClosest";
|
||||||
|
import {openMobileFileById} from "../../mobile/editor";
|
||||||
|
|
||||||
export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
|
export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
|
||||||
hideTooltip();
|
hideTooltip();
|
||||||
|
|
@ -214,22 +215,24 @@ export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
|
||||||
transferBlockRef(protyle.block.rootID);
|
transferBlockRef(protyle.block.rootID);
|
||||||
}
|
}
|
||||||
window.siyuan.menus.menu.append(new MenuItem({id: "separator_3", type: "separator"}).element);
|
window.siyuan.menus.menu.append(new MenuItem({id: "separator_3", type: "separator"}).element);
|
||||||
/// #if !MOBILE
|
|
||||||
if (!protyle.model) {
|
if (!protyle.model) {
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
id: "openBy",
|
id: "openBy",
|
||||||
label: window.siyuan.languages.openBy,
|
label: window.siyuan.languages.openBy,
|
||||||
icon: "iconOpen",
|
icon: "iconOpen",
|
||||||
click() {
|
click() {
|
||||||
|
/// #if !MOBILE
|
||||||
openFileById({
|
openFileById({
|
||||||
app: protyle.app,
|
app: protyle.app,
|
||||||
id: protyle.block.id,
|
id: protyle.block.id,
|
||||||
action: protyle.block.rootID !== protyle.block.id ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_CONTEXT],
|
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);
|
}).element);
|
||||||
}
|
}
|
||||||
/// #endif
|
|
||||||
/// #if !BROWSER
|
/// #if !BROWSER
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
id: "openByNewWindow",
|
id: "openByNewWindow",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue