From 9cd74597ac861fe0df84d5aca75d3de8f85aafc3 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 11 Jan 2024 22:38:38 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/10155 --- app/src/protyle/util/onGet.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.ts index 1d0b436da9c..2341b9c8b77 100644 --- a/app/src/protyle/util/onGet.ts +++ b/app/src/protyle/util/onGet.ts @@ -198,7 +198,7 @@ const setHTML = (options: { protyle.breadcrumb.element.nextElementSibling.textContent = ""; } protyle.element.removeAttribute("disabled-forever"); - setReadonlyByConfig(protyle); + setReadonlyByConfig(protyle, options.action); } focusElementById(protyle, options.action, options.scrollAttr); @@ -431,9 +431,11 @@ const focusElementById = (protyle: IProtyle, action: string[], scrollAttr?: IScr } }; -export const setReadonlyByConfig = (protyle: IProtyle) => { +export const setReadonlyByConfig = (protyle: IProtyle, action: string[]) => { let readOnly = window.siyuan.config.readonly ? "true" : "false"; - if (readOnly === "false") { + if (action?.includes(Constants.CB_GET_UNCHANGEID)) { + readOnly = protyle.disabled ? "true" : "false"; + } else if (readOnly === "false") { readOnly = window.siyuan.config.editor.readOnly ? "true" : "false"; if (readOnly === "false") { readOnly = protyle.wysiwyg.element.getAttribute(Constants.CUSTOM_SY_READONLY);