mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Add multi-select to networks, certificates and domains.
Fix multi-select count bug
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user