mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 16:58:49 +01:00
🎨 av enable and disable
This commit is contained in:
parent
d6128d9af5
commit
6b490db0eb
1 changed files with 12 additions and 0 deletions
|
|
@ -17,6 +17,7 @@ import {foldPassiveType} from "../wysiwyg/renderBacklink";
|
|||
import {showMessage} from "../../dialog/message";
|
||||
import {avRender} from "../render/av/render";
|
||||
import {hideTooltip} from "../../dialog/tooltip";
|
||||
import {stickyRow} from "../render/av/row";
|
||||
|
||||
export const onGet = (options: {
|
||||
data: IWebSocketData,
|
||||
|
|
@ -329,6 +330,13 @@ export const disabledProtyle = (protyle: IProtyle) => {
|
|||
protyle.wysiwyg.element.querySelectorAll('.protyle-action[draggable="true"]').forEach(item => {
|
||||
item.setAttribute("draggable", "false");
|
||||
});
|
||||
protyle.wysiwyg.element.querySelectorAll('.av').forEach((item: HTMLElement) => {
|
||||
const headerElement = item.querySelector(".av__row--header") as HTMLElement;
|
||||
if (headerElement) {
|
||||
headerElement.style.transform = "";
|
||||
(item.querySelector(".av__row--footer") as HTMLElement).style.transform = "";
|
||||
}
|
||||
});
|
||||
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);
|
||||
|
|
@ -366,6 +374,10 @@ export const enableProtyle = (protyle: IProtyle) => {
|
|||
protyle.wysiwyg.element.querySelectorAll('.protyle-action[draggable="false"]').forEach(item => {
|
||||
item.setAttribute("draggable", "true");
|
||||
});
|
||||
const contentRect = protyle.contentElement.getBoundingClientRect();
|
||||
protyle.wysiwyg.element.querySelectorAll('.av').forEach((item: HTMLElement) => {
|
||||
stickyRow(item, contentRect, "all");
|
||||
});
|
||||
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue