From c3665aef8feb40b758e572c80ff661db7f860487 Mon Sep 17 00:00:00 2001 From: Jeffrey Chen <78434827+TCOTC@users.noreply.github.com> Date: Mon, 3 Feb 2025 11:04:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=E6=B5=AE=E7=AA=97?= =?UTF-8?q?=E5=92=8C=E5=8F=8D=E9=93=BE=E4=B8=AD=E5=A4=9A=E4=BD=99=E7=9A=84?= =?UTF-8?q?=20.protyle-top=20=E5=85=83=E7=B4=A0=20(#13979)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix https://github.com/siyuan-note/siyuan/issues/13873 --- app/src/protyle/ui/initUI.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/src/protyle/ui/initUI.ts b/app/src/protyle/ui/initUI.ts index 6b10d3022..80ff6a11b 100644 --- a/app/src/protyle/ui/initUI.ts +++ b/app/src/protyle/ui/initUI.ts @@ -19,13 +19,20 @@ import {moveResize} from "../../dialog/moveResize"; export const initUI = (protyle: IProtyle) => { protyle.contentElement = document.createElement("div"); protyle.contentElement.className = "protyle-content"; - protyle.contentElement.innerHTML = '
'; - if (protyle.options.render.background) { - protyle.contentElement.firstElementChild.appendChild(protyle.background.element); + + const protyleTopElement = document.createElement("div"); + const shouldAddBackground = protyle.options.render.background; + const shouldAddTitle = protyle.options.render.title; + if (shouldAddBackground) { + protyleTopElement.appendChild(protyle.background.element); } - if (protyle.options.render.title) { - protyle.contentElement.firstElementChild.appendChild(protyle.title.element); + if (shouldAddTitle) { + protyleTopElement.appendChild(protyle.title.element); } + if (shouldAddBackground || shouldAddTitle) { + protyle.contentElement.appendChild(protyleTopElement); + } + protyle.contentElement.appendChild(protyle.wysiwyg.element); if (!protyle.options.action.includes(Constants.CB_GET_HISTORY)) { scrollEvent(protyle, protyle.contentElement);