mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 07:30:12 +01:00
This commit is contained in:
parent
6f57cbb65b
commit
adcdcefaf4
5 changed files with 85 additions and 41 deletions
|
|
@ -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);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue