Vanessa 2025-10-12 12:23:01 +08:00
parent bf38219c0a
commit a3252dbce5

View file

@ -728,6 +728,12 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
refreshTimeouts[protyle.id] = window.setTimeout(() => {
// 修改表格名 avID 传入到 id 上了 https://github.com/siyuan-note/siyuan/issues/12724
const avID = operation.action === "setAttrViewName" ? operation.id : operation.avID;
const attrElement = document.querySelector(`.b3-dialog--open[data-key="${Constants.DIALOG_ATTR}"] .custom-attr > [data-av-id="${avID}"]`) as HTMLElement;
if (attrElement) {
// 更新属性面板
attrElement.removeAttribute("data-rendering");
renderAVAttribute(attrElement.parentElement, attrElement.dataset.nodeId, protyle);
}
Array.from(protyle.wysiwyg.element.querySelectorAll(`.av[data-av-id="${avID}"]`)).forEach((item: HTMLElement) => {
item.removeAttribute("data-render");
if (operation.action === "sortAttrViewRow") {
@ -763,12 +769,6 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
}
const hasGhost = item.querySelector('[data-type="ghost"]');
avRender(item, protyle, () => {
const attrElement = document.querySelector(`.b3-dialog--open[data-key="${Constants.DIALOG_ATTR}"] .custom-attr > [data-av-id="${avID}"]`) as HTMLElement;
if (attrElement) {
// 更新属性面板
attrElement.removeAttribute("data-rendering");
renderAVAttribute(attrElement.parentElement, attrElement.dataset.nodeId, protyle);
} else {
if (operation.action === "insertAttrViewBlock" && operation.context?.ignoreTip !== "true") {
if (operation.context?.message) {
showMessage(operation.context.message);
@ -809,7 +809,6 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
openMenuPanel({protyle, blockElement: item, type: "config"});
}
}
}
item.removeAttribute("data-loading");
});
});