mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
move global search input to a general location
- create a global search store - create a half-baked context menu store -
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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;
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user