🐛 Improve setAttrViewCardSize (#15156)

fix https://github.com/siyuan-note/siyuan/issues/15092#issuecomment-3008758463
This commit is contained in:
Jeffrey Chen 2025-06-28 10:55:44 +08:00 committed by GitHub
parent bf0018e0c4
commit 97b32dd85d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -487,11 +487,13 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
}); });
} else if (operation.action === "hideAttrViewName") { } else if (operation.action === "hideAttrViewName") {
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => { Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {
const titleElement = item.querySelector(".av__title");
if (titleElement) {
if (!operation.data) { if (!operation.data) {
item.querySelector(".av__title").classList.remove("fn__none"); titleElement.classList.remove("fn__none");
} else { } else {
// hide // hide
item.querySelector(".av__title").classList.add("fn__none"); titleElement.classList.add("fn__none");
} }
if (item.getAttribute("data-av-type") === "gallery") { if (item.getAttribute("data-av-type") === "gallery") {
const galleryElement = item.querySelector(".av__gallery"); const galleryElement = item.querySelector(".av__gallery");
@ -502,6 +504,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
galleryElement.classList.add("av__gallery--top"); galleryElement.classList.add("av__gallery--top");
} }
} }
}
}); });
} else { } else {
// 修改表格名 avID 传入到 id 上了 https://github.com/siyuan-note/siyuan/issues/12724 // 修改表格名 avID 传入到 id 上了 https://github.com/siyuan-note/siyuan/issues/12724