Skip to content

Commit

Permalink
🐛 fix #10155
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Jan 11, 2024
1 parent 9a37cfd commit 9cd7459
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/src/protyle/util/onGet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9cd7459

Please sign in to comment.