From 310c5f704295ae9913977f943037b5c2ea0cdee4 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Mon, 4 Jul 2022 10:34:36 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E5=88=86=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/protyle/ui/initUI.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/protyle/ui/initUI.ts b/app/src/protyle/ui/initUI.ts index 0d544754d..7fa781c47 100644 --- a/app/src/protyle/ui/initUI.ts +++ b/app/src/protyle/ui/initUI.ts @@ -58,10 +58,6 @@ export const setPadding = (protyle: IProtyle) => { min16 = 96; min24 = 96; } - if (!window.siyuan.config.editor.fullWidth) { - // 防止右侧分屏后,左侧页签抖动 - protyle.wysiwyg.element.style.width = (protyle.element.clientWidth - 10) + "px"; - } } if (protyle.options.render.background && protyle.options.render.title) { protyle.background.element.lastElementChild.setAttribute("style", `left:${min16}px`); @@ -80,6 +76,13 @@ export const setPadding = (protyle: IProtyle) => { } } protyle.wysiwyg.element.style.padding = `16px ${min16}px ${bottomHeight} ${min24}px`; + if (!isMobile() && !window.siyuan.config.editor.fullWidth) { + // 防止右侧分屏后,左侧页签抖动;10 为滚动条宽度 + protyle.wysiwyg.element.style.width = (protyle.element.clientWidth - 10) + "px"; + if (protyle.options.render.title) { + protyle.title.element.style.width = (protyle.element.clientWidth - min16 - min24 - 10) + "px"; + } + } if (window.siyuan.config.editor.codeSyntaxHighlightLineNum) { protyle.wysiwyg.element.querySelectorAll('.code-block [contenteditable="true"]').forEach((block: HTMLElement) => { lineNumberRender(block);