From 13b0c9db802ae89b3d003d5895a5da89e9a3fb1b Mon Sep 17 00:00:00 2001 From: Denis Ryabov Date: Wed, 19 Jan 2022 19:44:11 +0300 Subject: [PATCH] map -> forEach --- media/com_jedchecker/js/script.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/media/com_jedchecker/js/script.js b/media/com_jedchecker/js/script.js index 634cb45..a0478d0 100644 --- a/media/com_jedchecker/js/script.js +++ b/media/com_jedchecker/js/script.js @@ -62,8 +62,8 @@ target.innerHTML = `${error.name}: ${error.message}`; [...sidebar.querySelectorAll('.badge.bg-danger')].forEach(el => el.textContent = '?'); - [...sidebar.querySelectorAll('.badge.bg-warning, .badge.bg-secondary, .badge.bg-info')].map(el => el.textContent = ''); - [...sidebar.querySelectorAll('.badge.bg-success, .spinner-border')].map(el => el.classList.add('hidden')); + [...sidebar.querySelectorAll('.badge.bg-warning, .badge.bg-secondary, .badge.bg-info')].forEach(el => el.textContent = ''); + [...sidebar.querySelectorAll('.badge.bg-success, .spinner-border')].forEach(el => el.classList.add('hidden')); }); } @@ -71,9 +71,9 @@ window.Joomla.submitbutton = function (task) { if (task === 'check') { [...document.querySelectorAll('.jedchecker-results')].forEach(el => el.classList.remove('hidden')); - [...document.querySelectorAll('.jedchecker-results .badge:not(.bg-success)')].map((el) => el.innerHTML = ''); - [...document.querySelectorAll('.jedchecker-results .badge.bg-success')].map((el) => el.classList.add('hidden')); - [...document.querySelectorAll('.jedchecker-results .spinner-border')].map((el) => el.classList.remove('hidden')); + [...document.querySelectorAll('.jedchecker-results .badge:not(.bg-success)')].forEach(el => el.innerHTML = ''); + [...document.querySelectorAll('.jedchecker-results .badge.bg-success')].forEach(el => el.classList.add('hidden')); + [...document.querySelectorAll('.jedchecker-results .spinner-border')].forEach(el => el.classList.remove('hidden')); [...document.querySelectorAll('.police-check-result')].forEach(el => el.innerHTML = '
'); if (!jed_collapse_init) {