From 2e0bc3764fa320ac9098bc0924d9ecbcf20b1310 Mon Sep 17 00:00:00 2001 From: gpkvt Date: Sun, 4 Jun 2023 22:38:09 +0200 Subject: [PATCH] improved reload trigger --- static/js/autoReload.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/static/js/autoReload.js b/static/js/autoReload.js index c998169..8e45ddc 100644 --- a/static/js/autoReload.js +++ b/static/js/autoReload.js @@ -17,14 +17,8 @@ function autoReload() { el.addEventListener('change', checkForm, { once: true }); }); - const choices = []; - function checkForm(e) { - item = e.target.id.charAt(1); - if (choices.indexOf(item) === -1) { - choices.push(item); - } - if (choices.length === 5) { + if (document.querySelectorAll('input[type="radio"]:checked').length == 5) { countdown(); } }