fix: don't check "select all" if there are no enabled checkboxes

This commit is contained in:
gasoved
2020-12-14 14:04:30 +03:00
committed by Julian Lam
parent 850bf497ea
commit 3ba0575584

View File

@@ -23,7 +23,7 @@ define('admin/modules/checkboxRowSelector', function () {
}
const checkboxes = $checkboxEl.closest('tr').find('input:not([disabled])').toArray();
const $toggler = $(checkboxes.shift());
const rowState = checkboxes.every(el => el.checked);
const rowState = checkboxes.length && checkboxes.every(el => el.checked);
$toggler.prop('checked', rowState);
};