diff --git a/app/src/card/openCard.ts b/app/src/card/openCard.ts index 94390c13a..37f1a7b47 100644 --- a/app/src/card/openCard.ts +++ b/app/src/card/openCard.ts @@ -150,8 +150,8 @@ export const genCardHTML = (options: { const getEditor = (id: string, protyle: IProtyle, element: Element, currentCard: ICard) => { fetchPost("/api/block/getDocInfo", { id, - }, (response) => { - protyle.wysiwyg.renderCustom(response.data.ial); + }, (docResponse) => { + protyle.wysiwyg.renderCustom(docResponse.data.ial); fetchPost("/api/filetree/getDoc", { id, mode: 0, @@ -163,6 +163,8 @@ const getEditor = (id: string, protyle: IProtyle, element: Element, currentCard: protyle, action: response.data.rootID === response.data.id ? [Constants.CB_GET_HTML] : [Constants.CB_GET_ALL, Constants.CB_GET_HTML], 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 && @@ -199,7 +201,7 @@ const getEditor = (id: string, protyle: IProtyle, element: Element, currentCard: if (btnIndex < 2) { return; } - element.previousElementSibling.textContent = currentCard.nextDues[btnIndex-1]; + element.previousElementSibling.textContent = currentCard.nextDues[btnIndex - 1]; }); actionElements[1].classList.remove("fn__none"); } else { @@ -250,6 +252,8 @@ export const bindCardEvent = async (options: { background: false, gutter: true, breadcrumbDocName: true, + title: true, + hideTitleOnZoom: true, }, typewriterMode: false }); @@ -418,7 +422,7 @@ export const bindCardEvent = async (options: { if (btnIndex < 2) { return; } - element.previousElementSibling.textContent = currentCard.nextDues[btnIndex-1]; + element.previousElementSibling.textContent = currentCard.nextDues[btnIndex - 1]; }); options.cardsData.unreviewedOldCardCount--; options.cardsData.unreviewedNewCardCount++; @@ -650,7 +654,7 @@ export const bindCardEvent = async (options: { if (btnIndex < 2) { return; } - element.previousElementSibling.textContent = currentCard.nextDues[btnIndex-1]; + element.previousElementSibling.textContent = currentCard.nextDues[btnIndex - 1]; }); actionElements[1].classList.remove("fn__none"); emitEvent(options.app, currentCard, type); diff --git a/app/src/protyle/header/Title.ts b/app/src/protyle/header/Title.ts index 01f09fc1e..e95cad3c8 100644 --- a/app/src/protyle/header/Title.ts +++ b/app/src/protyle/header/Title.ts @@ -344,6 +344,13 @@ export class Title { if (this.element.getAttribute("data-render") === "true") { return false; } + if (protyle.options.render.hideTitleOnZoom) { + if (protyle.block.showAll) { + this.element.classList.add("fn__none"); + } else { + this.element.classList.remove("fn__none"); + } + } this.element.setAttribute("data-node-id", protyle.block.rootID); if (response.data.ial[Constants.CUSTOM_RIFF_DECKS]) { this.element.setAttribute(Constants.CUSTOM_RIFF_DECKS, response.data.ial[Constants.CUSTOM_RIFF_DECKS]); diff --git a/app/src/protyle/util/Options.ts b/app/src/protyle/util/Options.ts index 5b2c76724..416c6c563 100644 --- a/app/src/protyle/util/Options.ts +++ b/app/src/protyle/util/Options.ts @@ -15,6 +15,7 @@ export class Options { scroll: false, breadcrumb: true, breadcrumbDocName: false, + hideTitleOnZoom: false, }, action: [], after: undefined, diff --git a/app/src/types/protyle.d.ts b/app/src/types/protyle.d.ts index f61b00d99..7114508b3 100644 --- a/app/src/types/protyle.d.ts +++ b/app/src/types/protyle.d.ts @@ -459,6 +459,7 @@ interface IProtyleOptions { scroll?: boolean breadcrumb?: boolean breadcrumbDocName?: boolean + hideTitleOnZoom?: boolean } /** 内部调试时使用 */ _lutePath?: string;