mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
This commit is contained in:
parent
8675b49daa
commit
0949236b45
2 changed files with 18 additions and 28 deletions
|
|
@ -111,6 +111,7 @@ export const openMenuPanel = (options: {
|
|||
<div class="b3-menu">${html}</div>
|
||||
</div>`);
|
||||
avPanelElement = document.querySelector(".av__panel");
|
||||
let closeCB: () => void;
|
||||
const menuElement = avPanelElement.lastElementChild as HTMLElement;
|
||||
const tabRect = options.blockElement.querySelector(`.av__views, .av__row[data-col-id="${options.colId}"] > .block__logo`)?.getBoundingClientRect();
|
||||
if (["select", "date", "asset", "relation", "rollup"].includes(options.type)) {
|
||||
|
|
@ -118,7 +119,7 @@ export const openMenuPanel = (options: {
|
|||
if (options.type === "select") {
|
||||
bindSelectEvent(options.protyle, data, menuElement, options.cellElements, options.blockElement);
|
||||
} else if (options.type === "date") {
|
||||
bindDateEvent({
|
||||
closeCB = bindDateEvent({
|
||||
protyle: options.protyle,
|
||||
data,
|
||||
menuElement,
|
||||
|
|
@ -465,6 +466,7 @@ export const openMenuPanel = (options: {
|
|||
// 过滤面板先关闭过滤条件
|
||||
window.siyuan.menus.menu.remove();
|
||||
} else {
|
||||
closeCB?.();
|
||||
avPanelElement.remove();
|
||||
focusBlock(options.blockElement);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue