mirror of
https://github.com/siyuan-note/siyuan
synced 2026-04-21 13:37:52 +00:00
This commit is contained in:
parent
7c182042e7
commit
0dc545607b
3 changed files with 10 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue