Vanessa 2023-12-01 11:05:27 +08:00
parent 0cf13cca8f
commit 2bcf4dcf71
3 changed files with 22 additions and 5 deletions

View file

@ -30,7 +30,8 @@ export const openMenuPanel = (options: {
blockElement: Element,
type: "select" | "properties" | "config" | "sorts" | "filters" | "edit" | "date" | "asset",
colId?: string, // for edit
cellElements?: HTMLElement[] // for select & date
cellElements?: HTMLElement[], // for select & date
cb?: (avPanelElement: Element) => void
}) => {
let avPanelElement = document.querySelector(".av__panel");
if (avPanelElement) {
@ -97,6 +98,9 @@ export const openMenuPanel = (options: {
bindViewEvent({protyle: options.protyle, data, menuElement});
}
}
if (options.cb) {
options.cb(avPanelElement);
}
avPanelElement.addEventListener("dragstart", (event: DragEvent) => {
window.siyuan.dragElement = event.target as HTMLElement;
window.siyuan.dragElement.style.opacity = ".1";