Widget: DCTList: Difference between revisions
From LINKS Community Center
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]; | ||
document.getElementById('functions-filter').dispatchEvent(new Event('change')); | |||
const filterBlock = subfunEl.closest('.func-filter-block'); | // const filterBlock = subfunEl.closest('.func-filter-block'); | ||
const category = filterBlock.querySelector('input.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"]'); | ||
// If no subfunctions are selected, deactivate the category. Activate otherwise. | // // If no subfunctions are selected, deactivate the category. Activate otherwise. | ||
const checkedSubs = Array.from(subfunctions).filter(sub => sub.checked).length; | // const checkedSubs = Array.from(subfunctions).filter(sub => sub.checked).length; | ||
category.checked = checkedSubs > 0; | // category.checked = checkedSubs > 0; | ||
}); | }); | ||
document.getElementById('functions-filter').closest('.filter-wrapper').classList.toggle('open'); | document.getElementById('functions-filter').closest('.filter-wrapper').classList.toggle('open'); | ||
} | } | ||
// Further filters | // Further filters | ||
// ... | // ... |
Revision as of 12:57, 5 June 2023
Current version of the DCT List.
Not ready for production!