- window.doClick = (elemId) => { document.getElementById(elemId).click() };
- store.initialize(this.$route.path);
- // NOTE: at this point, variants and tr(anslations) might be uninitialized
- },
+ // Several interactions on clicks on elements:
+ window.doClick = elemId => {
+ document.getElementById(elemId).click();
+ };
+ // Esc key can close 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)
+ ) {
+ m.checked = false;
+ }
+ });
+ }
+ });
+ store.initialize();
+ }