Vanessa 2024-02-26 23:39:10 +08:00
parent 6f57cbb65b
commit adcdcefaf4
5 changed files with 85 additions and 41 deletions

View file

@ -296,29 +296,15 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
} else {
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {
item.removeAttribute("data-render");
const isPulse = item.querySelector(".av__pulse");
avRender(item, protyle, () => {
if (operation.action === "addAttrViewCol" && isPulse) {
openMenuPanel({protyle, blockElement: item, type: "edit", colId: operation.id});
}
const attrElement = document.querySelector(`.b3-dialog--open[data-key="${Constants.DIALOG_ATTR}"] div[data-av-id="${operation.avID}"]`) as HTMLElement;
if (attrElement) {
// 更新属性面板
renderAVAttribute(attrElement.parentElement, attrElement.dataset.nodeId, protyle, (newElment) => {
if (operation.action === "addAttrViewCol") {
openMenuPanel({
protyle,
blockElement: newElment.querySelector(`div[data-av-id="${operation.avID}"]`),
type: "edit",
colId: operation.id
});
}
});
renderAVAttribute(attrElement.parentElement, attrElement.dataset.nodeId, protyle);
}
}, ["addAttrViewView", "duplicateAttrViewView"].includes(operation.action) ? operation.id :
(operation.action === "removeAttrViewView" ? null : undefined));
});
}
}, ["insertAttrViewBlock", "addAttrViewCol"].includes(operation.action) ? 2 : 100);
}, ["insertAttrViewBlock"].includes(operation.action) ? 2 : 100);
};