X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fmain.js;h=70b7d78a71052e15a5b21eb27e14c3239f1bd6f5;hb=725da57f8e2983d744629b524f9084516a43cbac;hp=6714939b6c544cc982a8dbbbb35740f21fbe97cd;hpb=5f13148449c73de92993b7961c077167563b84e5;p=vchess.git diff --git a/client/src/main.js b/client/src/main.js index 6714939b..70b7d78a 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -11,8 +11,17 @@ new Vue({ return h(App); }, created: function() { - window.doClick = (elemId) => { document.getElementById(elemId).click() }; - store.initialize(this.$route.path); - // NOTE: at this point, variants and tr(anslations) might be uninitialized - }, + window.doClick = elemId => { + document.getElementById(elemId).click(); + }; + document.addEventListener("keydown", e => { + if (e.code === "Escape") { + let modalBoxes = document.querySelectorAll("[id^='modal']"); + modalBoxes.forEach(m => { + if (m.checked && m.id != "modalAccept") m.checked = false; + }); + } + }); + store.initialize(); + } }).$mount("#app");