Skip to content

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

:lipstick:

Vanessabb49855133a8
diff --git a/app/src/protyle/render/av/openMenuPanel.ts b/app/src/protyle/render/av/openMenuPanel.ts
index 2ea1a9ea9d..80fa22db02 100644
--- a/app/src/protyle/render/av/openMenuPanel.ts
+++ b/app/src/protyle/render/av/openMenuPanel.ts
@@ -117,7 +117,7 @@ export const openMenuPanel = (options: {
setPosition(menuElement, cellRect.left, cellRect.bottom, cellRect.height);
}, Constants.TIMEOUT_LOAD); // 等待加载
} else if (options.type === "relation") {
- bindRelationEvent({protyle: options.protyle, data, menuElement, cellElements: options.cellElements});
+ bindRelationEvent({menuElement, cellElements: options.cellElements});
} else if (options.type === "rollup") {
bindRollupEvent({protyle: options.protyle, data, menuElement});
}
diff --git a/app/src/protyle/render/av/relation.ts b/app/src/protyle/render/av/relation.ts
index 68d8aedbae..91ba318590 100644
--- a/app/src/protyle/render/av/relation.ts
+++ b/app/src/protyle/render/av/relation.ts
@@ -7,6 +7,7 @@ import {transaction} from "../../wysiwyg/transaction";
import {updateCellsValue} from "./cell";
import {updateAttrViewCellAnimation} from "./action";
import {focusBlock} from "../../util/selection";
+import {setPosition} from "../../../util/setPosition";
const genSearchList = (element: Element, keyword: string, avId: string, cb?: () => void) => {
fetchPost("/api/av/searchAttributeView", {keyword}, (response) => {
@@ -214,8 +215,6 @@ const genSelectItemHTML = (type: "selected" | "empty" | "unselect", id?: string,
};
export const bindRelationEvent = (options: {
- protyle: IProtyle,
- data: IAV,
menuElement: HTMLElement,
cellElements: HTMLElement[]
}) => {
@@ -251,6 +250,8 @@ export const bindRelationEvent = (options: {
options.menuElement.innerHTML = `<div class="b3-menu__items">${selectHTML || genSelectItemHTML("empty")}
<button class="b3-menu__separator"></button>
${html || genSelectItemHTML("empty")}</div>`;
+ const cellRect = options.cellElements[options.cellElements.length - 1].getBoundingClientRect();
+ setPosition( options.menuElement, cellRect.left, cellRect.bottom, cellRect.height);
});
};