diff --git a/web/assets/javascripts/application.js b/web/assets/javascripts/application.js index a8e1d6c6..682d3bdf 100644 --- a/web/assets/javascripts/application.js +++ b/web/assets/javascripts/application.js @@ -9,7 +9,9 @@ var ready = (callback) => { else document.addEventListener("DOMContentLoaded", callback); } -ready(() => { +ready(addListeners) + +function addListeners() { document.querySelectorAll(".check_all").forEach(node => { node.addEventListener("click", event => { node.closest('table').querySelectorAll('input[type=checkbox]').forEach(inp => { inp.checked = !!node.checked; }); @@ -61,7 +63,7 @@ ready(() => { scheduleLivePoll(); } } -}) +} function updateFuzzyTimes() { var locale = document.body.getAttribute("data-locale"); @@ -107,5 +109,5 @@ function replacePage(text) { var header_status = doc.querySelector('.status') document.querySelector('.status').replaceWith(header_status) - updateFuzzyTimes(); + addListeners(); }