From bd396622158b5ea945e471ffb90166c1e8fedb11 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 6 Nov 2023 23:19:37 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/9596 --- app/src/menus/protyle.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts index 0973b0dc4..8bcebef70 100644 --- a/app/src/menus/protyle.ts +++ b/app/src/menus/protyle.ts @@ -1380,12 +1380,12 @@ const genImageWidthMenu = (label: string, assetElement: HTMLElement, imgElement: click() { nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss")); if (label === window.siyuan.languages.default) { - if (assetElement.style.display === "block") { - assetElement.style.width = ""; - } else { - assetElement.removeAttribute("style"); - } + const isCenter = assetElement.style.display === "block" + assetElement.removeAttribute("style"); imgElement.removeAttribute("style"); + if (isCenter) { + assetElement.style.display = "block"; + } } else { assetElement.style.width = label; imgElement.style.width = "10000px";