diff --git a/airlock/static/assets/file_browser/dir.js b/airlock/static/assets/file_browser/dir.js index 3d4f8578..3a3655aa 100644 --- a/airlock/static/assets/file_browser/dir.js +++ b/airlock/static/assets/file_browser/dir.js @@ -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|undefined} */ + const checkboxes = form?.querySelectorAll('input[type="checkbox"]'); - checkboxes.forEach(function(checkbox) { + checkboxes?.forEach(function(checkbox) { checkbox.checked = elem.checked; }); }