mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
658e7cdbb7
- create a global search store - create a half-baked context menu store -
22 lines
486 B
JavaScript
22 lines
486 B
JavaScript
import { defineStore } from "pinia";
|
|
import normalizeContextMenu from "../composables/normalizeContextMenu";
|
|
|
|
export default defineStore("context-menu", {
|
|
state: () => ({
|
|
visible: false,
|
|
x: 0,
|
|
y: 0,
|
|
}),
|
|
actions: {
|
|
showContextMenu(e) {
|
|
this.visible = true;
|
|
const { normalX, normalY } = normalizeContextMenu(e.clientX, e.clientY);
|
|
this.x = normalX;
|
|
this.y = normalY;
|
|
},
|
|
hideContextMenu() {
|
|
this.visible = false;
|
|
},
|
|
},
|
|
});
|