poprawka w suwaku

This commit is contained in:
Mateusz Gruszczyński
2025-08-18 00:40:25 +02:00
parent 5d977c644b
commit 7762cba541
2 changed files with 18 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
document.addEventListener('DOMContentLoaded', function () {
const showAllCheckbox = document.getElementById('showAllLists');
if (!showAllCheckbox) return;
const params = new URLSearchParams(window.location.search);
if (!params.has('show_all')) {
params.set('show_all', 'true');
window.history.replaceState({}, '', `${window.location.pathname}?${params.toString()}`);
}
showAllCheckbox.checked = params.get('show_all') === 'true';
showAllCheckbox.addEventListener('change', function () {
const urlParams = new URLSearchParams(window.location.search);
urlParams.set('show_all', showAllCheckbox.checked ? 'true' : 'false');
window.location.search = urlParams.toString();
});
});

View File

@@ -163,9 +163,9 @@
{% block scripts %}
<script src="{{ url_for('static_bp.serve_js_lib', filename='chart.js') }}"></script>
<script src="{{ url_for('static_bp.serve_js', filename='show_all_expense.js') }}"></script>
<script src="{{ url_for('static_bp.serve_js', filename='expense_chart.js') }}"></script>
<script src="{{ url_for('static_bp.serve_js', filename='expense_table.js') }}"></script>
<script src="{{ url_for('static_bp.serve_js', filename='expense_tab.js') }}"></script>
<script src="{{ url_for('static_bp.serve_js', filename='select_all_table.js') }}"></script>
{% endblock %}