mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 01:20:12 +01:00
This commit is contained in:
parent
62b84e0e9d
commit
3c6d2fc417
3 changed files with 59 additions and 24 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import {fetchPost} from "../../../util/fetch";
|
||||
import {getColIconByType} from "./col";
|
||||
import {showHeaderCellMenu} from "./cell";
|
||||
import {Constants} from "../../../constants";
|
||||
|
||||
export const avRender = (element: Element, cb?: () => void) => {
|
||||
let avElements: Element[] = [];
|
||||
|
|
@ -101,12 +102,14 @@ export const avRender = (element: Element, cb?: () => void) => {
|
|||
}
|
||||
};
|
||||
|
||||
let lastparentID:string
|
||||
let lastParentID: string
|
||||
let lastElement: HTMLElement
|
||||
export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
|
||||
if (lastparentID === operation.parentID) {
|
||||
if (lastParentID === operation.parentID && protyle.contentElement.isSameNode(lastElement)) {
|
||||
return
|
||||
}
|
||||
lastparentID = operation.parentID;
|
||||
lastElement = protyle.contentElement;
|
||||
lastParentID = operation.parentID;
|
||||
if (operation.action === "addAttrViewCol") {
|
||||
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.parentID}"]`)).forEach((item: HTMLElement) => {
|
||||
item.removeAttribute("data-render");
|
||||
|
|
@ -120,4 +123,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
|
|||
avRender(item);
|
||||
});
|
||||
}
|
||||
setTimeout(() => {
|
||||
lastParentID = null;
|
||||
}, Constants.TIMEOUT_TRANSITION);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue