enhance: allow longpress and contextmenu copy paste

This commit is contained in:
Julian Krauser 2025-07-22 07:50:26 +02:00
parent 518e05b842
commit e755a4ec37
7 changed files with 144 additions and 18 deletions

View file

@ -8,6 +8,7 @@ export const useContextMenuStore = defineStore("context-menu", {
show: false,
component_ref: null as any,
data: null as any,
clickedOnEl: null as any,
};
},
getters: {
@ -16,16 +17,18 @@ export const useContextMenuStore = defineStore("context-menu", {
},
},
actions: {
openContextMenu(e: MouseEvent, content: { component_ref: any; data: any }) {
openContextMenu(e: MouseEvent, content: { component_ref: any; data?: any }) {
this.component_ref = content.component_ref;
this.data = content.data;
this.contextX = e.pageX;
this.contextY = e.pageY;
this.clickedOnEl = e.target;
this.show = true;
},
closeContextMenu() {
this.component_ref = null;
this.data = null;
this.clickedOnEl = null;
this.show = false;
},
},