X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fmain.js;h=7015362bcc567e2383c32fdf6b7a60d6e6217318;hb=4f51861013271a060b358884097a676e3d42d496;hp=674852db31eae7ee96844b5c9f56eaff48423f06;hpb=80ee5d5a70f17f78900a8a3ae2d803ed1f2f14c9;p=vchess.git diff --git a/client/src/main.js b/client/src/main.js index 674852db..7015362b 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -12,7 +12,17 @@ new Vue({ }, created: function() { window.doClick = (elemId) => { document.getElementById(elemId).click() }; - // TODO: why is this wrong? + 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]); // NOTE: at this point, variants and tr(anslations) might be uninitialized