mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
hide context menu on right click again
This commit is contained in:
@@ -4,16 +4,22 @@ import normalize from "../composables/normalizeContextMenu";
|
||||
export default defineStore("context-menu", {
|
||||
state: () => ({
|
||||
visible: false,
|
||||
options: [],
|
||||
x: 0,
|
||||
y: 0,
|
||||
}),
|
||||
actions: {
|
||||
showContextMenu(e) {
|
||||
this.visible = true;
|
||||
showContextMenu(e, context_options) {
|
||||
if (this.visible) {
|
||||
this.visible = false;
|
||||
return
|
||||
}
|
||||
|
||||
this.options = context_options;
|
||||
const yo = normalize(e.clientX, e.clientY);
|
||||
this.x = yo.normalizedX;
|
||||
this.y = yo.normalizedY;
|
||||
console.log(yo);
|
||||
this.visible = true;
|
||||
},
|
||||
hideContextMenu() {
|
||||
this.visible = false;
|
||||
|
||||
Reference in New Issue
Block a user