podzial dzienny
This commit is contained in:
@@ -108,6 +108,15 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
const toggleBtn = document.getElementById("toggleCategorySplit");
|
||||
toggleBtn.addEventListener("click", function () {
|
||||
categorySplit = !categorySplit;
|
||||
|
||||
// Znajdź aktualnie aktywny przycisk podziału czasu
|
||||
let activeRange = 'currentmonth'; // domyślna wartość
|
||||
if (document.getElementById('toggleDailySplit').classList.contains('btn-primary')) {
|
||||
activeRange = 'daily';
|
||||
} else if (document.getElementById('toggleMonthlySplit').classList.contains('btn-primary')) {
|
||||
activeRange = 'monthly';
|
||||
}
|
||||
|
||||
if (categorySplit) {
|
||||
this.textContent = "🔵 Pokaż całościowo";
|
||||
this.classList.remove("btn-outline-warning");
|
||||
@@ -117,9 +126,8 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
this.classList.remove("btn-outline-info");
|
||||
this.classList.add("btn-outline-warning");
|
||||
}
|
||||
loadExpenses();
|
||||
loadExpenses(activeRange);
|
||||
});
|
||||
|
||||
|
||||
toggleBtn.textContent = "🔵 Pokaż całościowo";
|
||||
toggleBtn.classList.remove("btn-outline-warning");
|
||||
|
Reference in New Issue
Block a user