Vanessa 2025-06-22 23:33:39 +08:00
parent 6ab2cea36d
commit 6c5cacabde
2 changed files with 4 additions and 1 deletions

View file

@ -206,7 +206,7 @@ class="fn__flex-1 fn__flex${["url", "text", "number", "email", "phone", "block"]
innerHTML += `<div class="fn__hr"></div>
<button data-type="addColumn" class="b3-button b3-button--cancel"><svg><use xlink:href="#iconAdd"></use></svg>${window.siyuan.languages.newCol}</button>
<div class="fn__hr--b"></div><div class="fn__hr--b"></div>`;
html += `<div data-av-id="${table.avID}" data-node-id="${id}" data-type="NodeAttributeView">${innerHTML}</div>`;
html += `<div data-av-id="${table.avID}" data-av-type="table" data-node-id="${id}" data-type="NodeAttributeView">${innerHTML}</div>`;
if (element.innerHTML) {
// 防止 blockElement 找不到

View file

@ -18,6 +18,9 @@ import {insertGalleryItemAnimation} from "./gallery/item";
import {clearSelect} from "../../util/clearSelect";
export const getFieldIdByCellElement = (cellElement: Element, viewType: TAVView): string => {
if (hasClosestByClassName(cellElement, "custom-attr")) {
return (hasClosestByClassName(cellElement, "av__row") as HTMLElement).dataset.id;
}
return (hasClosestByClassName(cellElement, viewType === "table" ? "av__row" : "av__gallery-item") as HTMLElement).dataset.id;
};