X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fmain.js;h=9d2e73d1878a1ce37e8453378906ef244db94695;hb=1ac94d6fcd258b56a1c1bdf39e6a1e757a99e9fc;hp=08893dbccc3e83a1edb7d4a39a1cca7c860956d4;hpb=4486a21e09c50f65da5d4c3648430cea1b19a0cc;p=vchess.git diff --git a/client/src/main.js b/client/src/main.js index 08893dbc..9d2e73d1 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -12,6 +12,19 @@ new Vue({ }, created: function() { window.doClick = (elemId) => { document.getElementById(elemId).click() }; - store.initialize(); + document.addEventListener("keydown", (e) => { + if (e.code === "Escape") + { + let modalBoxes = document.querySelectorAll("[id^='modal']"); + modalBoxes.forEach(m => { + if (m.checked) + m.checked = false; + }); + } + }); + // TODO: why is this wrong? (Maybe because $route still uninitialized?) + //store.initialize(this.$route.path); + store.initialize(window.location.href.split("#")[1].split("?")[0]); + // NOTE: at this point, variants and tr(anslations) might be uninitialized }, }).$mount("#app");