Sfoglia il codice sorgente

:bug: fix https://github.com/siyuan-note/siyuan/issues/10155

Vanessa 1 anno fa
parent
commit
9cd74597ac
1 ha cambiato i file con 5 aggiunte e 3 eliminazioni
  1. 5 3
      app/src/protyle/util/onGet.ts

+ 5 - 3
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);