Skip to content

Commit

Permalink
Simplify dir script for based on datatables
Browse files Browse the repository at this point in the history
  • Loading branch information
tomodwyer committed Sep 12, 2024
1 parent 326c4f6 commit 3731d20
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions airlock/static/assets/file_browser/dir.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// ensure datatable is initialised when loading over HTMX
window.initCustomTable ? window.initCustomTable() : null;

// implement select all checkbox
function toggleSelectAll(elem, event) {
function toggleSelectAll(elem) {
const form = document.querySelector("#multiselect_form");

const checkboxes = form.querySelectorAll('input[type="checkbox"]');
/** @type {NodeListOf<HTMLInputElement>|undefined} */
const checkboxes = form?.querySelectorAll('input[type="checkbox"]');

checkboxes.forEach(function(checkbox) {
checkboxes?.forEach(function(checkbox) {
checkbox.checked = elem.checked;
});
}

0 comments on commit 3731d20

Please sign in to comment.