mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 10:00:13 +01:00
💄
This commit is contained in:
parent
190b82fb39
commit
bb49855133
2 changed files with 4 additions and 3 deletions
|
|
@ -117,7 +117,7 @@ export const openMenuPanel = (options: {
|
||||||
setPosition(menuElement, cellRect.left, cellRect.bottom, cellRect.height);
|
setPosition(menuElement, cellRect.left, cellRect.bottom, cellRect.height);
|
||||||
}, Constants.TIMEOUT_LOAD); // 等待加载
|
}, Constants.TIMEOUT_LOAD); // 等待加载
|
||||||
} else if (options.type === "relation") {
|
} else if (options.type === "relation") {
|
||||||
bindRelationEvent({protyle: options.protyle, data, menuElement, cellElements: options.cellElements});
|
bindRelationEvent({menuElement, cellElements: options.cellElements});
|
||||||
} else if (options.type === "rollup") {
|
} else if (options.type === "rollup") {
|
||||||
bindRollupEvent({protyle: options.protyle, data, menuElement});
|
bindRollupEvent({protyle: options.protyle, data, menuElement});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import {transaction} from "../../wysiwyg/transaction";
|
||||||
import {updateCellsValue} from "./cell";
|
import {updateCellsValue} from "./cell";
|
||||||
import {updateAttrViewCellAnimation} from "./action";
|
import {updateAttrViewCellAnimation} from "./action";
|
||||||
import {focusBlock} from "../../util/selection";
|
import {focusBlock} from "../../util/selection";
|
||||||
|
import {setPosition} from "../../../util/setPosition";
|
||||||
|
|
||||||
const genSearchList = (element: Element, keyword: string, avId: string, cb?: () => void) => {
|
const genSearchList = (element: Element, keyword: string, avId: string, cb?: () => void) => {
|
||||||
fetchPost("/api/av/searchAttributeView", {keyword}, (response) => {
|
fetchPost("/api/av/searchAttributeView", {keyword}, (response) => {
|
||||||
|
|
@ -214,8 +215,6 @@ const genSelectItemHTML = (type: "selected" | "empty" | "unselect", id?: string,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const bindRelationEvent = (options: {
|
export const bindRelationEvent = (options: {
|
||||||
protyle: IProtyle,
|
|
||||||
data: IAV,
|
|
||||||
menuElement: HTMLElement,
|
menuElement: HTMLElement,
|
||||||
cellElements: HTMLElement[]
|
cellElements: HTMLElement[]
|
||||||
}) => {
|
}) => {
|
||||||
|
|
@ -251,6 +250,8 @@ export const bindRelationEvent = (options: {
|
||||||
options.menuElement.innerHTML = `<div class="b3-menu__items">${selectHTML || genSelectItemHTML("empty")}
|
options.menuElement.innerHTML = `<div class="b3-menu__items">${selectHTML || genSelectItemHTML("empty")}
|
||||||
<button class="b3-menu__separator"></button>
|
<button class="b3-menu__separator"></button>
|
||||||
${html || genSelectItemHTML("empty")}</div>`;
|
${html || genSelectItemHTML("empty")}</div>`;
|
||||||
|
const cellRect = options.cellElements[options.cellElements.length - 1].getBoundingClientRect();
|
||||||
|
setPosition( options.menuElement, cellRect.left, cellRect.bottom, cellRect.height);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue