Add multi-select to networks, certificates and domains.

Fix multi-select count bug
This commit is contained in:
Marcus Hill
2023-12-31 12:49:58 +00:00
parent 9076012d2a
commit 1b567ee253
8 changed files with 313 additions and 185 deletions

View File

@@ -1,6 +1,10 @@
var checkboxes = document.querySelectorAll('form input[type="checkbox"]');
// Allow selecting and editing multiple records at once
var form = document.getElementById("multi_actions"); // Get the form element by its id
var checkboxes = form.querySelectorAll('input[type="checkbox"]');
var selectedCount = document.getElementById("selectedCount");
for (var i = 0; i < checkboxes.length; i++) {
checkboxes[i].addEventListener("click", updateSelectedCount);
}
@@ -9,7 +13,9 @@ function updateSelectedCount() {
var count = 0;
for (var i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].checked) {
count++;
if (checkboxes[i] !== document.getElementById("selectAllCheckbox") && checkboxes[i].checked) {
count++;
}
}
}
selectedCount.textContent = count;