Set active state on selected filter widgets

This commit is contained in:
Jürgen Mummert
2026-02-22 12:16:39 +01:00
parent b525f37862
commit 99dd6fcc81
@@ -97,6 +97,8 @@
const tagButtons = Array.from(filters.querySelectorAll('button[data-filter-tag]')); const tagButtons = Array.from(filters.querySelectorAll('button[data-filter-tag]'));
const locationSelect = filters.querySelector('#location-filter'); const locationSelect = filters.querySelector('#location-filter');
const orgSelect = filters.querySelector('#org-filter'); const orgSelect = filters.querySelector('#org-filter');
const locationWidget = locationSelect?.closest('.widget-select');
const orgWidget = orgSelect?.closest('.widget-select');
const status = filters.querySelector('#eventfilter-status'); const status = filters.querySelector('#eventfilter-status');
const animationMs = 220; const animationMs = 220;
@@ -142,10 +144,12 @@
if (locationSelect) { if (locationSelect) {
locationSelect.classList.toggle('active', type === 'location'); locationSelect.classList.toggle('active', type === 'location');
locationWidget?.classList.toggle('active', type === 'location');
} }
if (orgSelect) { if (orgSelect) {
orgSelect.classList.toggle('active', type === 'org'); orgSelect.classList.toggle('active', type === 'org');
orgWidget?.classList.toggle('active', type === 'org');
} }
}; };