Difference between revisions of "Widget:DCTList"

From LINKS Community Center
Jump to: navigation, search
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 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) {
 +
                    console.log('clicked the cat!')
 +
                }
 +
 
                 // Picking at least one subfunction activates the category.
 
                 // Picking at least one subfunction activates the category.
 
                 // Picking zero subfunctions deactivates the category.
 
                 // Picking zero subfunctions deactivates the category.
                 console.log(filterBlock)
+
                 // console.log(filterBlock)
                 console.log(subfunctions)
+
                 // console.log(subfunctions)
 
                 applyFilters();
 
                 applyFilters();
 
             }, { passive: true });
 
             }, { passive: true });

Revision as of 16:48, 18 November 2022

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