mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 16:58:49 +01:00
This commit is contained in:
parent
b36dc7a20f
commit
ace4d5c9e0
1 changed files with 4 additions and 3 deletions
|
|
@ -124,6 +124,7 @@ const setHTML = (options: {
|
|||
}
|
||||
protyle.block.showAll = options.action.includes(Constants.CB_GET_ALL);
|
||||
const REMOVED_OVER_HEIGHT = protyle.contentElement.clientHeight * 8;
|
||||
const isUpdate = protyle.wysiwyg.element.innerHTML !== ""
|
||||
if (options.action.includes(Constants.CB_GET_APPEND)) {
|
||||
// 动态加载移除
|
||||
if (!protyle.wysiwyg.element.querySelector(".protyle-wysiwyg--select") && !protyle.scroll.keepLazyLoad && protyle.contentElement.scrollHeight > REMOVED_OVER_HEIGHT) {
|
||||
|
|
@ -198,7 +199,7 @@ const setHTML = (options: {
|
|||
protyle.breadcrumb.element.nextElementSibling.textContent = "";
|
||||
}
|
||||
protyle.element.removeAttribute("disabled-forever");
|
||||
setReadonlyByConfig(protyle, options.action);
|
||||
setReadonlyByConfig(protyle, isUpdate);
|
||||
}
|
||||
|
||||
focusElementById(protyle, options.action, options.scrollAttr);
|
||||
|
|
@ -431,9 +432,9 @@ const focusElementById = (protyle: IProtyle, action: string[], scrollAttr?: IScr
|
|||
}
|
||||
};
|
||||
|
||||
export const setReadonlyByConfig = (protyle: IProtyle, action: string[]) => {
|
||||
export const setReadonlyByConfig = (protyle: IProtyle, isUpdate: boolean) => {
|
||||
let readOnly = window.siyuan.config.readonly ? "true" : "false";
|
||||
if (action?.includes(Constants.CB_GET_UNCHANGEID)) {
|
||||
if (isUpdate) {
|
||||
readOnly = protyle.disabled ? "true" : "false";
|
||||
} else if (readOnly === "false") {
|
||||
readOnly = window.siyuan.config.editor.readOnly ? "true" : "false";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue