X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fmain.js;h=7e9ce9cc5541af820bed21a93d5ef0f5ca81aec5;hb=5b4de147a4e2f737c660f3e82f46664a9635477f;hp=2d855b8a2a284415dc25bd5dbe6b9fb092fed132;hpb=d641bec1b3b299e16b7da93f966dad0b0bd35088;p=vchess.git diff --git a/client/src/main.js b/client/src/main.js index 2d855b8a..7e9ce9cc 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -11,18 +11,22 @@ new Vue({ return h(App); }, created: function() { - window.doClick = (elemId) => { document.getElementById(elemId).click() }; - document.addEventListener("keydown", (e) => { - if (e.code === "Escape") - { + 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) + if ( + m.checked && + !["modalAccept","modalConfirm"].includes(m.id) + ) { m.checked = false; + } }); } }); - // NOTE: store.initialize(this.$route.path); doesn't work - store.initialize(window.location.href.split("#")[1].split("?")[0]); - }, + store.initialize(); + } }).$mount("#app");