Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/9854

Vanessa1444f12f0d0e
diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts
index 8a6e0854d7..43ad05d231 100644
--- a/app/src/protyle/gutter/index.ts
+++ b/app/src/protyle/gutter/index.ts
@@ -1,4 +1,10 @@
-import {hasClosestBlock, hasClosestByAttribute, hasClosestByMatchTag, hasClosestByTag} from "../util/hasClosest";
+import {
+ hasClosestBlock,
+ hasClosestByAttribute,
+ hasClosestByClassName,
+ hasClosestByMatchTag,
+ hasClosestByTag
+} from "../util/hasClosest";
import {getIconByType} from "../../editor/getIcon";
import {enterBack, iframeMenu, setFold, tableMenu, videoMenu, zoomOut} from "../../menus/protyle";
import {MenuItem} from "../../menus/Menu";
@@ -241,6 +247,7 @@ export class Gutter {
window.siyuan.menus.menu.fullscreen();
} else {
window.siyuan.menus.menu.popup({x: event.clientX - 16, y: event.clientY - 16, isLeft: true});
+ window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app")
focusByRange(protyle.toolbar.range);
}
}
@@ -253,6 +260,7 @@ export class Gutter {
if (!window.siyuan.ctrlIsPressed && !window.siyuan.altIsPressed && !window.siyuan.shiftIsPressed) {
this.renderMenu(protyle, buttonElement);
window.siyuan.menus.menu.popup({x: event.clientX - 16, y: event.clientY - 16, isLeft: true});
+ window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app")
}
event.preventDefault();
event.stopPropagation();