Vanessa 2023-07-16 23:19:58 +08:00
parent e4e4879911
commit 452b7dddb9

View file

@ -201,11 +201,12 @@ export const avContextmenu = (protyle: IProtyle, event: MouseEvent & { detail: a
}); });
} }
const editAttrSubmenu: IMenu[] = []; const editAttrSubmenu: IMenu[] = [];
rowElement.parentElement.querySelectorAll(".av__row--header .av__cell").forEach((cellElement) => { rowElement.parentElement.querySelectorAll(".av__row--header .av__cell").forEach((cellElement: HTMLElement) => {
editAttrSubmenu.push({ editAttrSubmenu.push({
icon: getColIconByType(cellElement.getAttribute("data-dtype") as TAVCol), icon: getColIconByType(cellElement.getAttribute("data-dtype") as TAVCol),
label: cellElement.textContent.trim(), label: cellElement.textContent.trim(),
click() { click() {
popTextCell(protyle, rowElement.querySelector(`.av__cell[data-col-id="${cellElement.dataset.colId}"]`));
} }
}); });
}); });
@ -242,7 +243,7 @@ export const updateAVName = (protyle: IProtyle, blockElement: Element) => {
transaction(protyle, [{ transaction(protyle, [{
action: "setAttrViewName", action: "setAttrViewName",
id: avId, id: avId,
data: nameElement.textContent.trim(), data: nameElement.textContent.trim(),
}], [{ }], [{
action: "setAttrViewName", action: "setAttrViewName",
id: avId, id: avId,