Compare commits

...

2 Commits

Author SHA1 Message Date
Jürgen Mummert a03612dc9c Set active state on selected filter widgets 2026-02-22 12:16:39 +01:00
Jürgen Mummert b525f37862 Wrap select filters in dedicated container 2026-02-22 12:14:24 +01:00
@@ -7,24 +7,26 @@
{% endfor %} {% endfor %}
</div> </div>
<div class="widget-select places"> <div class="select-filters">
<label for="location-filter" class="visually-hidden">Orte:</label> <div class="widget-select places">
<select id="location-filter"> <label for="location-filter" class="visually-hidden">Orte:</label>
<option value="all">Orte</option> <select id="location-filter">
{% for location in locations|default([]) %} <option value="all">Orte</option>
<option value="location-{{ location.id }}">{{ location.title }} ({{ location.count }})</option> {% for location in locations|default([]) %}
{% endfor %} <option value="location-{{ location.id }}">{{ location.title }} ({{ location.count }})</option>
</select> {% endfor %}
</div> </select>
</div>
<div class="widget-select org"> <div class="widget-select org">
<label for="org-filter" class="visually-hidden">Veranstalter:</label> <label for="org-filter" class="visually-hidden">Veranstalter:</label>
<select id="org-filter"> <select id="org-filter">
<option value="all">Veranstalter</option> <option value="all">Veranstalter</option>
{% for organization in organizations|default([]) %} {% for organization in organizations|default([]) %}
<option value="org-{{ organization.id }}">{{ organization.title }} ({{ organization.count }})</option> <option value="org-{{ organization.id }}">{{ organization.title }} ({{ organization.count }})</option>
{% endfor %} {% endfor %}
</select> </select>
</div>
</div> </div>
<p id="eventfilter-status" class="visually-hidden" aria-live="polite"></p> <p id="eventfilter-status" class="visually-hidden" aria-live="polite"></p>
@@ -95,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;
@@ -140,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');
} }
}; };