refactoring

This commit is contained in:
Roland Gruber 2023-01-10 07:56:23 +01:00
parent e3a917b7e6
commit 534c8048d4

View file

@ -125,15 +125,23 @@ function SubmitForm(id, e) {
*/ */
function list_switchAccountSelection() { function list_switchAccountSelection() {
// set checkbox selection // set checkbox selection
jQuery('input.accountBoxUnchecked').prop('checked', true); document.querySelectorAll('input.accountBoxUnchecked').forEach(item => {
jQuery('input.accountBoxChecked').prop('checked', false); item.checked = true;
});
document.querySelectorAll('input.accountBoxChecked').forEach(item => {
item.checked = false;
});
// switch CSS class // switch CSS class
var nowChecked = jQuery('.accountBoxUnchecked'); const nowChecked = document.querySelectorAll('input.accountBoxUnchecked');
var nowUnchecked = jQuery('.accountBoxChecked'); const nowUnchecked = document.querySelectorAll('input.accountBoxChecked');
nowChecked.addClass('accountBoxChecked'); nowChecked.forEach(item => {
nowChecked.removeClass('accountBoxUnchecked'); item.classList.add('accountBoxChecked');
nowUnchecked.addClass('accountBoxUnchecked'); item.classList.remove('accountBoxUnchecked');
nowUnchecked.removeClass('accountBoxChecked'); });
nowUnchecked.forEach(item => {
item.classList.remove('accountBoxChecked');
item.classList.add('accountBoxUnchecked');
});
} }
/** /**