mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-07-03 14:09:06 +02:00
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user