Fix Arena diag
[vchess.git] / client / src / main.js
... / ...
CommitLineData
1import Vue from "vue";
2import App from "./App.vue";
3import router from "./router";
4import { store } from "./store";
5
6Vue.config.productionTip = false;
7
8new Vue({
9 router,
10 render: function(h) {
11 return h(App);
12 },
13 created: function() {
14 // Several interactions on clicks on elements:
15 window.doClick = elemId => {
16 document.getElementById(elemId).click();
17 };
18 // Esc key can close some modals:
19 document.addEventListener("keydown", e => {
20 if (e.code === "Escape") {
21 let modalBoxes = document.querySelectorAll("[id^='modal']");
22 modalBoxes.forEach(m => {
23 if (
24 m.checked &&
25 !["Accept", "Confirm", "Chat", "People"]
26 .includes(m.id.substr(5)) //modalThing --> Thing
27 ) {
28 m.checked = false;
29 }
30 });
31 }
32 });
33 store.initialize();
34 }
35}).$mount("#app");