Vanessa 2026-04-20 22:02:23 +08:00
parent 7c182042e7
commit 0dc545607b
3 changed files with 10 additions and 2 deletions

View file

@ -100,7 +100,7 @@ export const fullscreen = (element: Element, btnElement?: Element) => {
};
export const updateReadonly = (target: Element, protyle: IProtyle) => {
if (!window.siyuan.config.readonly) {
if (!window.siyuan.config.readonly && protyle.element.getAttribute("disabled-forever") !== "true") {
const isReadonly = target.querySelector("use").getAttribute("xlink:href") !== "#iconUnlock";
if (window.siyuan.config.editor.readOnly) {
if (isReadonly) {

View file

@ -573,6 +573,9 @@ ${padHTML}
}
public render(protyle: IProtyle, update = false, nodeElement?: Element | false) {
if (protyle.element.getAttribute("disabled-forever") === "true") {
return;
}
/// #if !MOBILE
let range: Range;
let blockElement: Element;

View file

@ -251,7 +251,12 @@ const setHTML = (options: {
if (protyle.breadcrumb) {
protyle.breadcrumb.element.nextElementSibling.textContent = "";
}
protyle.element.removeAttribute("disabled-forever");
if (protyle.element.hasAttribute("disabled-forever")) {
if (protyle.wysiwyg.element.getAttribute("custom-sy-readonly") === "false") {
protyle.disabled = false;
}
protyle.element.removeAttribute("disabled-forever");
}
if (options.action.includes(Constants.CB_GET_OPENNEW) && window.siyuan.config.editor.readOnly && !window.siyuan.config.readonly) {
enableProtyle(protyle);
} else {