mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
This commit is contained in:
parent
8a16755fd8
commit
1848f5aae0
2 changed files with 13 additions and 2 deletions
|
|
@ -8,6 +8,7 @@ import {hasClosestBlock, hasClosestByClassName} from "../../util/hasClosest";
|
|||
import {stickyRow} from "./row";
|
||||
import {getCalcValue} from "./calc";
|
||||
import {renderAVAttribute} from "./blockAttr";
|
||||
import {showMessage} from "../../../dialog/message";
|
||||
|
||||
export const avRender = (element: Element, protyle: IProtyle, cb?: () => void, viewID?: string) => {
|
||||
let avElements: Element[] = [];
|
||||
|
|
@ -301,11 +302,17 @@ 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 updateRow = item.querySelector('.av__row[data-need-update="true"]');
|
||||
avRender(item, protyle, () => {
|
||||
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);
|
||||
} else {
|
||||
if (operation.action === "insertAttrViewBlock" && updateRow && !item.querySelector(`.av__row[data-id="${updateRow.getAttribute("data-id")}"]`)) {
|
||||
showMessage(window.siyuan.languages.insertRowTip);
|
||||
document.querySelector(".av__mask")?.remove();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue