Vanessa 2024-09-27 22:53:19 +08:00 committed by Daniel
parent ccc09569e0
commit 6ff4b621b2
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 9 additions and 1 deletions

View file

@ -488,6 +488,11 @@ export const openMenuPanel = (options: {
window.siyuan.dragElement = undefined;
}
});
avPanelElement.addEventListener("mousedown", (event: MouseEvent & { target: HTMLElement }) => {
if (event.button === 1 && !hasClosestByClassName(event.target, "b3-menu")) {
document.querySelector(".av__panel").dispatchEvent(new CustomEvent("click", {detail: "close"}));
}
});
avPanelElement.addEventListener("click", (event: MouseEvent) => {
let type: string;
if (typeof event.detail === "string") {