Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: Improve setAttrViewCardSize (#15156)

Jeffrey Chen97b32dd85dc8
diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts
index b433411abc..d50c231e02 100644
--- a/app/src/protyle/render/av/render.ts
+++ b/app/src/protyle/render/av/render.ts
@@ -487,19 +487,22 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
});
} else if (operation.action === "hideAttrViewName") {
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {
- if (!operation.data) {
- item.querySelector(".av__title").classList.remove("fn__none");
- } else {
- // hide
- item.querySelector(".av__title").classList.add("fn__none");
- }
- if (item.getAttribute("data-av-type") === "gallery") {
- const galleryElement = item.querySelector(".av__gallery");
+ const titleElement = item.querySelector(".av__title");
+ if (titleElement) {
if (!operation.data) {
- galleryElement.classList.remove("av__gallery--top");
+ titleElement.classList.remove("fn__none");
} else {
// hide
- galleryElement.classList.add("av__gallery--top");
+ titleElement.classList.add("fn__none");
+ }
+ if (item.getAttribute("data-av-type") === "gallery") {
+ const galleryElement = item.querySelector(".av__gallery");
+ if (!operation.data) {
+ galleryElement.classList.remove("av__gallery--top");
+ } else {
+ // hide
+ galleryElement.classList.add("av__gallery--top");
+ }
}
}
});