Merge pull request #68

feat(transactions): proper clear button for filters
This commit is contained in:
Herculino Trotta
2025-01-25 01:30:43 -03:00
committed by GitHub
3 changed files with 8 additions and 2 deletions

View File

@@ -9,4 +9,10 @@
end
end
end
on reset
for elm in <select/> in event.target
call elm.tomselect.clear()
end
end
</script>

View File

@@ -129,6 +129,7 @@
id="filter">
{% crispy filter.form %}
</form>
<button class="btn btn-outline-danger btn-sm" _="on click call #filter.reset() then trigger change on #filter">{% translate 'Clear' %}</button>
</div>
</div>
{# Transactions list#}

View File

@@ -14,8 +14,7 @@
<div class="d-flex mb-3 align-self-center">
<div class="me-auto"><h4><i class="fa-solid fa-filter me-2"></i>{% translate 'Filter' %}</h4></div>
<div class="align-self-center">
<a href="{% url 'transactions_all_index' %}" type="button" class="btn btn-outline-danger btn-sm"
hx-target="body" hx-boost="true">{% translate 'Clear' %}</a>
<button class="btn btn-outline-danger btn-sm" _="on click call #filter.reset() then trigger change on #filter">{% translate 'Clear' %}</button>
</div>
</div>
<hr>