From 534c8048d4da8895e848a54ee5ea6ca2a57fe1c2 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Tue, 10 Jan 2023 07:56:23 +0100 Subject: [PATCH] refactoring --- lam/templates/lib/500_lam.js | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/lam/templates/lib/500_lam.js b/lam/templates/lib/500_lam.js index 3ebda47a2..1a05002f5 100644 --- a/lam/templates/lib/500_lam.js +++ b/lam/templates/lib/500_lam.js @@ -125,15 +125,23 @@ function SubmitForm(id, e) { */ function list_switchAccountSelection() { // set checkbox selection - jQuery('input.accountBoxUnchecked').prop('checked', true); - jQuery('input.accountBoxChecked').prop('checked', false); + document.querySelectorAll('input.accountBoxUnchecked').forEach(item => { + item.checked = true; + }); + document.querySelectorAll('input.accountBoxChecked').forEach(item => { + item.checked = false; + }); // switch CSS class - var nowChecked = jQuery('.accountBoxUnchecked'); - var nowUnchecked = jQuery('.accountBoxChecked'); - nowChecked.addClass('accountBoxChecked'); - nowChecked.removeClass('accountBoxUnchecked'); - nowUnchecked.addClass('accountBoxUnchecked'); - nowUnchecked.removeClass('accountBoxChecked'); + const nowChecked = document.querySelectorAll('input.accountBoxUnchecked'); + const nowUnchecked = document.querySelectorAll('input.accountBoxChecked'); + nowChecked.forEach(item => { + item.classList.add('accountBoxChecked'); + item.classList.remove('accountBoxUnchecked'); + }); + nowUnchecked.forEach(item => { + item.classList.remove('accountBoxChecked'); + item.classList.add('accountBoxUnchecked'); + }); } /**