diff --git a/static/js/expense_table.js b/static/js/expense_table.js index c8971cc..35de2ba 100644 --- a/static/js/expense_table.js +++ b/static/js/expense_table.js @@ -4,10 +4,9 @@ document.addEventListener('DOMContentLoaded', () => { const filterButtons = document.querySelectorAll('.range-btn'); const rows = document.querySelectorAll('#listsTableBody tr'); const categoryButtons = document.querySelectorAll('.category-filter'); - const onlyWith = document.getElementById('onlyWithExpenses'); window.selectedCategoryId = ""; - let initialLoad = true; // flaga - true tylko przy pierwszym wejściu + let initialLoad = true; function updateTotal() { let total = 0; @@ -74,7 +73,6 @@ document.addEventListener('DOMContentLoaded', () => { } function applyExpenseFilter() { - if (!onlyWith || !onlyWith.checked) return; rows.forEach(row => { const amt = parseFloat(row.querySelector('.list-checkbox').dataset.amount || 0); if (amt <= 0) row.style.display = 'none'; @@ -121,23 +119,6 @@ document.addEventListener('DOMContentLoaded', () => { }); }); - // Checkbox "tylko z wydatkami" - if (onlyWith) { - onlyWith.addEventListener('change', () => { - if (initialLoad) { - filterByLast30Days(); - } else { - const activeRange = document.querySelector('.range-btn.active'); - if (activeRange) { - filterByRange(activeRange.dataset.range); - } - } - applyExpenseFilter(); - applyCategoryFilter(); - updateTotal(); - }); - } - // Obsługa kliknięcia w kategorię categoryButtons.forEach(btn => { btn.addEventListener('click', () => { diff --git a/templates/expenses.html b/templates/expenses.html index 94abfa1..b7d2765 100644 --- a/templates/expenses.html +++ b/templates/expenses.html @@ -75,15 +75,6 @@ -