Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/11944

Vanessad5673ceb762a
diff --git a/app/src/protyle/preview/index.ts b/app/src/protyle/preview/index.ts
index d810624e6c..ab9b377a0f 100644
--- a/app/src/protyle/preview/index.ts
+++ b/app/src/protyle/preview/index.ts
@@ -126,6 +126,12 @@ export class Preview {
break;
} else if (target.tagName === "BUTTON") {
const type = target.getAttribute("data-type");
+ if (type !== "mp-wechat" && type !== "zhihu" && type !== "yuque") {
+ actionElement.querySelectorAll("button").forEach((item) => {
+ item.classList.remove("protyle-preview__action--current");
+ });
+ target.classList.add("protyle-preview__action--current");
+ }
const actionCustom = actions.find((w: IPreviewActionCustom) => w?.key === type) as IPreviewActionCustom;
if (actionCustom) {
actionCustom.click(type);
@@ -143,12 +149,6 @@ export class Preview {
previewElement.style.width = "360px";
previewElement.style.padding = "8px";
}
- if (type !== "mp-wechat" && type !== "zhihu" && type !== "yuque") {
- actionElement.querySelectorAll("button").forEach((item) => {
- item.classList.remove("protyle-preview__action--current");
- });
- target.classList.add("protyle-preview__action--current");
- }
}
target = target.parentElement;
}
@@ -184,7 +184,7 @@ export class Preview {
}
public updatePadding(padding: { left: number, right: number, bottom: number, top: number }) {
- if (this.element.style.display !== "none" &&
+ if (!this.element.classList.contains("fn__none") &&
this.element.querySelector('.protyle-preview__action [data-type="desktop"]')?.classList.contains("protyle-preview__action--current")) {
this.previewElement.style.padding = `${padding.top}px ${padding.left}px ${padding.bottom}px ${padding.right}px`;
}