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:
geoffrey45
2022-03-12 08:56:38 +03:00
parent 39fba364d3
commit 658e7cdbb7
21 changed files with 538 additions and 245 deletions
+21
View File
@@ -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;
},
},
});