diff --git a/blocks/adp-collection-header/adp-collection-header.js b/blocks/adp-collection-header/adp-collection-header.js index 82a8725c..9ccea497 100644 --- a/blocks/adp-collection-header/adp-collection-header.js +++ b/blocks/adp-collection-header/adp-collection-header.js @@ -4,7 +4,7 @@ import { decorateIcons } from '../../scripts/lib-franklin.js'; import { createLinkHref, navigateTo } from '../../scripts/scripts.js'; import { - selectAllAssets,deselectAllAssets, + selectAllAssets, deselectAllAssets, } from '../adp-infinite-results-collection/adp-infinite-results-collection.js'; @@ -37,14 +37,8 @@ function createCollectionInfoHeader(collectionInfoHeader, collection) { const backButton = collectionInfoHeader.querySelector('.back-button a'); backButton.href = createLinkHref(backButton.href); - document.getElementById('select-all-checkbox').addEventListener('click', function(event) { - // Get the checked state of the select all checkbox - const isChecked = event.target.checked; - - // Get all the checkboxes within the cards - const checkboxes = document.querySelectorAll('.checkbox-container input[type="checkbox"], .filetype-video .checkbox-container input[type="checkbox"]'); - // isChecked then selectAllAssets() else deselectAllAssets - isChecked ? selectAllAssets() : deselectAllAssets(); + document.getElementById('select-all-checkbox').addEventListener('click', (event) => { + event.target.checked ? selectAllAssets() : deselectAllAssets(); }); collectionInfoHeader.querySelector('.action-collection-delete').addEventListener('click', async (e) => { diff --git a/blocks/adp-share-header/adp-share-header.js b/blocks/adp-share-header/adp-share-header.js index 768263d7..ab300dc7 100644 --- a/blocks/adp-share-header/adp-share-header.js +++ b/blocks/adp-share-header/adp-share-header.js @@ -18,17 +18,10 @@ function createShareInfoHeader(shareInfoHeader) { - `; - document.getElementById('select-all-checkbox').addEventListener('click', function(event) { - // Get the checked state of the select all checkbox - const isChecked = event.target.checked; - - // Get all the checkboxes within the cards - const checkboxes = document.querySelectorAll('.checkbox-container input[type="checkbox"], .filetype-video .checkbox-container input[type="checkbox"]'); - // isChecked then selectAllAssets() else deselectAllAssets - isChecked ? selectAllAssets() : deselectAllAssets(); + document.getElementById('select-all-checkbox').addEventListener('click', (event) => { + event.target.checked ? selectAllAssets() : deselectAllAssets(); }); decorateIcons(shareInfoHeader);