From 42a9284896b9cf9a579d32b7cf77dfc1f5786472 Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Wed, 11 Mar 2020 09:36:48 +0100 Subject: [PATCH] Fixes --- client/src/App.vue | 9 +-------- client/src/components/BaseGame.vue | 5 ++--- client/src/components/ContactForm.vue | 7 ++++++- client/src/components/MoveList.vue | 7 +++---- client/src/components/Settings.vue | 13 ++++++++----- client/src/components/UpsertUser.vue | 7 ++++++- client/src/translations/en.js | 8 ++++---- client/src/translations/es.js | 8 ++++---- client/src/translations/fr.js | 8 ++++---- client/src/variants/Antiking.js | 1 + client/src/views/Game.vue | 7 ++++--- client/src/views/Hall.vue | 4 ++-- client/src/views/Problems.vue | 3 +-- 13 files changed, 46 insertions(+), 41 deletions(-) diff --git a/client/src/App.vue b/client/src/App.vue index 312f324a..8258dc3e 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -44,8 +44,7 @@ import ContactForm from "@/components/ContactForm.vue"; import Settings from "@/components/Settings.vue"; import UpsertUser from "@/components/UpsertUser.vue"; -import { store } from "./store.js"; -import { processModalClick } from "./utils/modalClick.js"; +import { store } from "@/store.js"; export default { components: { ContactForm, @@ -57,12 +56,6 @@ export default { st: store.state }; }, - mounted: function() { - let dialogs = document.querySelectorAll("div[role='dialog']"); - dialogs.forEach(d => { - d.addEventListener("click", processModalClick); - }); - }, methods: { hideDrawer: function(e) { e.preventDefault(); //TODO: why is this needed? diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue index 0d5a3bbc..8e88b055 100644 --- a/client/src/components/BaseGame.vue +++ b/client/src/components/BaseGame.vue @@ -138,9 +138,8 @@ export default { baseGameDiv.addEventListener("keydown", this.handleKeys); baseGameDiv.addEventListener("wheel", this.handleScroll); } - document.getElementById("eogDiv").addEventListener( - "click", - processModalClick); + document.getElementById("eogDiv") + .addEventListener("click", processModalClick); }, methods: { focusBg: function() { diff --git a/client/src/components/ContactForm.vue b/client/src/components/ContactForm.vue index 50270e69..e5d27326 100644 --- a/client/src/components/ContactForm.vue +++ b/client/src/components/ContactForm.vue @@ -4,7 +4,7 @@ div type="checkbox" @change="trySetEnterTime($event)" ) - div( + div#contactDiv( role="dialog" data-checkbox="modalContact" ) @@ -26,6 +26,7 @@ div import { ajax } from "@/utils/ajax"; import { store } from "@/store"; import { checkNameEmail } from "@/data/userCheck"; +import { processModalClick } from "@/utils/modalClick.js"; export default { name: "my-contact-form", data: function() { @@ -35,6 +36,10 @@ export default { infoMsg: "" }; }, + mounted: function() { + document.getElementById("contactDiv") + .addEventListener("click", processModalClick); + }, methods: { trySetEnterTime: function(event) { if (event.target.checked) { diff --git a/client/src/components/MoveList.vue b/client/src/components/MoveList.vue index 4428f298..c4e19982 100644 --- a/client/src/components/MoveList.vue +++ b/client/src/components/MoveList.vue @@ -74,9 +74,8 @@ export default { }; }, mounted: function() { - document.getElementById("adjuster").addEventListener( - "click", - processModalClick); + document.getElementById("adjuster") + .addEventListener("click", processModalClick); if ("ontouchstart" in window) { // Disable tooltips on smartphones: document.querySelectorAll("#aboveMoves .tooltip").forEach(elt => { @@ -226,6 +225,6 @@ span#rulesBtn button margin: 0 -button.tooltip +#aboveMoves button padding-bottom: 5px diff --git a/client/src/components/Settings.vue b/client/src/components/Settings.vue index 7e90b0f2..5b79e06e 100644 --- a/client/src/components/Settings.vue +++ b/client/src/components/Settings.vue @@ -1,7 +1,7 @@