X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fmain.js;h=3577b15577728aa25e17edf041727ac698606664;hb=1ef65040168ab7d55ce921abc9d63644a937d689;hp=7e9ce9cc5541af820bed21a93d5ef0f5ca81aec5;hpb=5b4de147a4e2f737c660f3e82f46664a9635477f;p=vchess.git diff --git a/client/src/main.js b/client/src/main.js index 7e9ce9cc..3577b155 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -11,16 +11,19 @@ new Vue({ return h(App); }, created: function() { + // Several interactions on clicks on elements: window.doClick = elemId => { document.getElementById(elemId).click(); }; + // Esc key can close some modals: document.addEventListener("keydown", e => { if (e.code === "Escape") { let modalBoxes = document.querySelectorAll("[id^='modal']"); modalBoxes.forEach(m => { if ( m.checked && - !["modalAccept","modalConfirm"].includes(m.id) + !["modalAccept", "modalConfirm", "modalChat", "modalPeople"] + .includes(m.id) ) { m.checked = false; }