Widget: DCTList: Difference between revisions

From LINKS Community Center
Jump to: navigation, search
Eschmidt (talk | contribs)
No edit summary
Eschmidt (talk | contribs)
No edit summary
Line 675: Line 675:
             document.getElementById('functions-filter').addEventListener('change', event => {
             document.getElementById('functions-filter').addEventListener('change', event => {
                 const filterBlock = event.target.closest('.func-filter-block');
                 const filterBlock = event.target.closest('.func-filter-block');
                 const category = filterBlock.querySelector('.func-cat');
                 const category = filterBlock.querySelector('input.func-cat');
                 const subfunctions = filterBlock.querySelectorAll('.subfunc-filter-block input[type="checkbox"]');
                 const subfunctions = filterBlock.querySelectorAll('.subfunc-filter-block input[type="checkbox"]');


                 // Selecting/deselecting the category checks/unchecks all subfunctions.
                 // Selecting/deselecting the category checks/unchecks all subfunctions.
                 if (event.target === category) {
                 if (event.target === category) {
                     console.log('clicked the cat!')
                     subfunctions.forEach(checkbox => checkbox.checked = category.checked);
                 }
                 }



Revision as of 15:51, 18 November 2022

Development verstion of the DCT List.
Not ready for production!