From ce57b8e7db8905637ec8d19f15bb5ff00386402e Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Mon, 11 Aug 2025 00:03:47 +0200 Subject: [PATCH] feat: remove global context menu event listener and handler to allow regular context menu where a custom one isn't needed --- app.vue | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/app.vue b/app.vue index c105499..72bffa2 100644 --- a/app.vue +++ b/app.vue @@ -12,16 +12,11 @@ import type { ContextMenuInterface } from './types/interfaces'; const banner = useState("banner", () => false); -const contextMenu = useState("contextMenu"); +const contextMenu = useState("contextMenu", () => ({ show: false, pointerX: 0, pointerY: 0, items: [] })); onMounted(() => { loadPreferredThemes() - document.removeEventListener("contextmenu", contextMenuHandler); - document.addEventListener("contextmenu", (e) => { - if (e.target instanceof Element && e.target.classList.contains("default-contextmenu")) return; - contextMenuHandler(e); - }); document.addEventListener("mousedown", (e) => { if (e.target instanceof HTMLElement && e.target.classList.contains("context-menu-item")) return; console.log("click"); @@ -55,14 +50,6 @@ onMounted(() => { }); }); -function contextMenuHandler(e: MouseEvent) { - e.preventDefault(); - //console.log("Opened context menu"); - //createContextMenu(e, [ - // { name: "Wah", callback: () => { return } } - //]); -} -