mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user