wip: Add ban and kick to context menu #69
1 changed files with 1 additions and 14 deletions
15
app.vue
15
app.vue
|
@ -12,16 +12,11 @@ import type { ContextMenuInterface } from './types/interfaces';
|
|||
|
||||
const banner = useState("banner", () => false);
|
||||
|
||||
const contextMenu = useState<ContextMenuInterface>("contextMenu");
|
||||
const contextMenu = useState<ContextMenuInterface>("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 } }
|
||||
//]);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue