mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-28 11:16:09 +01:00
This commit is contained in:
parent
bf1172b05e
commit
41b14025b4
5 changed files with 4 additions and 21 deletions
|
|
@ -161,10 +161,8 @@ const getEditor = (id: string, protyle: IProtyle, element: Element, currentCard:
|
|||
updateReadonly: true,
|
||||
data: response,
|
||||
protyle,
|
||||
action: response.data.rootID === response.data.id ? [Constants.CB_GET_HTML] : [Constants.CB_GET_ALL, Constants.CB_GET_HTML],
|
||||
action: response.data.rootID === response.data.id ? [] : [Constants.CB_GET_ALL],
|
||||
afterCB: () => {
|
||||
protyle.title.element.removeAttribute("data-render");
|
||||
protyle.title.render(protyle, docResponse);
|
||||
let hasHide = false;
|
||||
if (!window.siyuan.config.flashcard.superBlock &&
|
||||
!window.siyuan.config.flashcard.heading &&
|
||||
|
|
|
|||
|
|
@ -313,11 +313,7 @@ const getArticle = (edit: Protyle, id: string) => {
|
|||
updateReadonly: true,
|
||||
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);
|
||||
}
|
||||
action: getResponse.data.rootID === getResponse.data.id ? [] : [Constants.CB_GET_ALL],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ export class Title {
|
|||
}
|
||||
|
||||
public render(protyle: IProtyle, response: IWebSocketData) {
|
||||
if (this.element.getAttribute("data-render") === "true") {
|
||||
if (this.element.getAttribute("data-render") === "true" && this.element.dataset.nodeId === protyle.block.rootID) {
|
||||
return false;
|
||||
}
|
||||
if (protyle.options.render.hideTitleOnZoom) {
|
||||
|
|
|
|||
|
|
@ -91,17 +91,6 @@ export const onGet = (options: {
|
|||
isSyncing: options.data.data.isSyncing,
|
||||
afterCB: options.afterCB,
|
||||
}, options.protyle);
|
||||
|
||||
// 如果需要渲染标题且包含 CB_GET_HTML,需要获取文档信息来更新标题
|
||||
if (options.protyle.options.render.title && options.action.includes(Constants.CB_GET_HTML)) {
|
||||
fetchPost("/api/block/getDocInfo", {
|
||||
id: options.protyle.block.rootID
|
||||
}, (response) => {
|
||||
options.protyle.title.element.removeAttribute("data-render");
|
||||
options.protyle.title.render(options.protyle, response);
|
||||
});
|
||||
}
|
||||
|
||||
removeLoading(options.protyle);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1118,7 +1118,7 @@ export const getArticle = (options: {
|
|||
updateReadonly: true,
|
||||
data: getResponse,
|
||||
protyle: options.edit.protyle,
|
||||
action: zoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_HTML] : [Constants.CB_GET_HTML],
|
||||
action: zoomIn ? [Constants.CB_GET_ALL] : [],
|
||||
});
|
||||
|
||||
const contentRect = options.edit.protyle.contentElement.getBoundingClientRect();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue