mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 08:30:42 +02:00
This commit is contained in:
parent
0dd00d2138
commit
ad6fe1cd6e
8 changed files with 136 additions and 21 deletions
|
@ -314,6 +314,13 @@ export const disabledProtyle = (protyle: IProtyle) => {
|
|||
if (protyle.breadcrumb) {
|
||||
protyle.breadcrumb.element.parentElement.querySelector('[data-type="readonly"] use').setAttribute("xlink:href", "#iconLock");
|
||||
protyle.breadcrumb.element.parentElement.querySelector('[data-type="readonly"]').setAttribute("aria-label", window.siyuan.config.editor.readOnly ? window.siyuan.languages.tempUnlock : window.siyuan.languages.unlockEdit);
|
||||
const undoElement = protyle.breadcrumb.element.parentElement.querySelector('[data-type="undo"]')
|
||||
if (undoElement && !undoElement.classList.contains("fn__none")) {
|
||||
undoElement.classList.add("fn__none")
|
||||
protyle.breadcrumb.element.parentElement.querySelector('[data-type="redo"]').classList.add("fn__none")
|
||||
protyle.breadcrumb.element.parentElement.querySelector('[data-type="indent"]').classList.add("fn__none")
|
||||
protyle.breadcrumb.element.parentElement.querySelector('[data-type="outdent"]').classList.add("fn__none")
|
||||
}
|
||||
}
|
||||
hideTooltip();
|
||||
};
|
||||
|
@ -357,6 +364,13 @@ export const enableProtyle = (protyle: IProtyle) => {
|
|||
if (protyle.breadcrumb) {
|
||||
protyle.breadcrumb.element.parentElement.querySelector('[data-type="readonly"] use').setAttribute("xlink:href", "#iconUnlock");
|
||||
protyle.breadcrumb.element.parentElement.querySelector('[data-type="readonly"]').setAttribute("aria-label", window.siyuan.config.editor.readOnly ? window.siyuan.languages.cancelTempUnlock : window.siyuan.languages.lockEdit);
|
||||
const undoElement = protyle.breadcrumb.element.parentElement.querySelector('[data-type="undo"]')
|
||||
if (undoElement && undoElement.classList.contains("fn__none")) {
|
||||
undoElement.classList.remove("fn__none")
|
||||
protyle.breadcrumb.element.parentElement.querySelector('[data-type="redo"]').classList.remove("fn__none")
|
||||
protyle.breadcrumb.element.parentElement.querySelector('[data-type="indent"]').classList.remove("fn__none")
|
||||
protyle.breadcrumb.element.parentElement.querySelector('[data-type="outdent"]').classList.remove("fn__none")
|
||||
}
|
||||
}
|
||||
hideTooltip();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue