podzial dzienny
This commit is contained in:
@@ -165,12 +165,20 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
|
||||
// Automatyczne ładowanie danych po przełączeniu na zakładkę Wykres
|
||||
document.getElementById('chart-tab').addEventListener('shown.bs.tab', function () {
|
||||
loadExpenses();
|
||||
// Sprawdź jaki tryb jest aktywny (domyślnie dzienny lub miesięczny)
|
||||
if (document.getElementById('toggleDailySplit').classList.contains('btn-primary')) {
|
||||
loadExpenses('daily');
|
||||
} else if (document.getElementById('toggleMonthlySplit').classList.contains('btn-primary')) {
|
||||
loadExpenses('monthly');
|
||||
} else {
|
||||
loadExpenses('currentmonth'); // Albo inna domyślna wartość
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Jeśli jesteśmy od razu na zakładce Wykres
|
||||
if (document.getElementById('chart-tab').classList.contains('active')) {
|
||||
loadExpenses("currentmonth");
|
||||
}
|
||||
//if (document.getElementById('chart-tab').classList.contains('active')) {
|
||||
// loadExpenses("currentmonth");
|
||||
// }
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user