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 672: Line 672:
                                 const subfunEl = document.getElementById('subfunc-filter-' + escapeAttr(subfun));
                                 const subfunEl = document.getElementById('subfunc-filter-' + escapeAttr(subfun));
                                 subfunEl.checked = !!functions[subfun];
                                 subfunEl.checked = !!functions[subfun];
                                 subfunEl.dispatchEvent(new Event('change', { bubbles: true }));
                                 subfunEl.dispatchEvent(new Event('change', { bubbles: true }));
                               
                                // const filterBlock = subfunEl.closest('.func-filter-block');
                                // const category = filterBlock.querySelector('input.func-cat');
                                // const subfunctions = filterBlock.querySelectorAll('.subfunc-filter-block input[type="checkbox"]');
                                // // If no subfunctions are selected, deactivate the category. Activate otherwise.
                                // const checkedSubs = Array.from(subfunctions).filter(sub => sub.checked).length;
                                // category.checked = checkedSubs > 0;
                             });
                             });


Line 777: Line 768:
             // Listen for changes in filter checkbox state.
             // Listen for changes in filter checkbox state.
             document.getElementById('functions-filter').addEventListener('change', event => {
             document.getElementById('functions-filter').addEventListener('change', event => {
                console.log('EVT:CHANGE')
                 const filterBlock = event.target.closest('.func-filter-block');
                 const filterBlock = event.target.closest('.func-filter-block');
                 const category = filterBlock.querySelector('input.func-cat');
                 const category = filterBlock.querySelector('input.func-cat');

Revision as of 13:03, 5 June 2023

Current version of the DCT List.
Not ready for production!