From f3f1b0beace4a5603d0e3939694ba679abdb9188 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 3 Feb 2025 11:11:13 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/pull/13979 --- app/src/protyle/ui/initUI.ts | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/app/src/protyle/ui/initUI.ts b/app/src/protyle/ui/initUI.ts index 80ff6a11b..639f5dbdb 100644 --- a/app/src/protyle/ui/initUI.ts +++ b/app/src/protyle/ui/initUI.ts @@ -20,17 +20,14 @@ export const initUI = (protyle: IProtyle) => { protyle.contentElement = document.createElement("div"); protyle.contentElement.className = "protyle-content"; - 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 (shouldAddTitle) { - protyleTopElement.appendChild(protyle.title.element); - } - if (shouldAddBackground || shouldAddTitle) { - protyle.contentElement.appendChild(protyleTopElement); + if (protyle.options.render.background || protyle.options.render.title) { + protyle.contentElement.innerHTML = '
'; + if (protyle.options.render.background) { + protyle.contentElement.firstElementChild.appendChild(protyle.background.element); + } + if (protyle.options.render.title) { + protyle.contentElement.firstElementChild.appendChild(protyle.title.element); + } } protyle.contentElement.appendChild(protyle.wysiwyg.element);