mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Ajax some report parts.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* globals google, startDate ,reportURL, endDate , reportType ,accountIds, lineChart, categoryReportUrl, balanceReportUrl */
|
||||
/* globals google, budgetReportUrl, startDate ,reportURL, endDate , reportType ,accountIds, lineChart, categoryReportUrl, balanceReportUrl */
|
||||
|
||||
|
||||
$(function () {
|
||||
@@ -7,6 +7,7 @@ $(function () {
|
||||
|
||||
loadCategoryReport();
|
||||
loadBalanceReport();
|
||||
loadBudgetReport();
|
||||
});
|
||||
|
||||
function loadCategoryReport() {
|
||||
@@ -15,12 +16,26 @@ function loadCategoryReport() {
|
||||
$.get(categoryReportUrl).done(placeCategoryReport).fail(failCategoryReport);
|
||||
}
|
||||
|
||||
function loadBudgetReport() {
|
||||
"use strict";
|
||||
console.log('Going to grab ' + budgetReportUrl);
|
||||
$.get(budgetReportUrl).done(placeBudgetReport).fail(failBudgetReport);
|
||||
}
|
||||
|
||||
|
||||
function loadBalanceReport() {
|
||||
"use strict";
|
||||
console.log('Going to grab ' + categoryReportUrl);
|
||||
$.get(balanceReportUrl).done(placeBalanceReport).fail(failBalanceReport);
|
||||
}
|
||||
|
||||
function placeBudgetReport(data) {
|
||||
"use strict";
|
||||
$('#budgetReport').removeClass('loading').html(data);
|
||||
listLengthInitial();
|
||||
triggerInfoClick();
|
||||
}
|
||||
|
||||
function placeBalanceReport(data) {
|
||||
"use strict";
|
||||
$('#balanceReport').removeClass('loading').html(data);
|
||||
@@ -35,6 +50,12 @@ function placeCategoryReport(data) {
|
||||
triggerInfoClick();
|
||||
}
|
||||
|
||||
function failBudgetReport() {
|
||||
"use strict";
|
||||
console.log('Fail budget report data!');
|
||||
$('#budgetReport').removeClass('loading').addClass('general-chart-error');
|
||||
}
|
||||
|
||||
function failBalanceReport() {
|
||||
"use strict";
|
||||
console.log('Fail balance report data!');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* globals google, startDate ,reportURL, endDate , reportType ,accountIds , picker:true, minDate, year, month, columnChart, lineChart, stackedColumnChart */
|
||||
/* globals google, accountIds, budgetYearOverviewUrl */
|
||||
|
||||
var chartDrawn;
|
||||
var budgetChart;
|
||||
@@ -7,8 +7,29 @@ $(function () {
|
||||
chartDrawn = false;
|
||||
drawChart();
|
||||
|
||||
//
|
||||
loadBudgetOverview();
|
||||
});
|
||||
|
||||
function loadBudgetOverview() {
|
||||
"use strict";
|
||||
console.log('Going to grab ' + budgetYearOverviewUrl);
|
||||
$.get(budgetYearOverviewUrl).done(placeBudgetOverview).fail(failBudgetOverview);
|
||||
}
|
||||
|
||||
function placeBudgetOverview(data) {
|
||||
"use strict";
|
||||
$('#budgetOverview').removeClass('loading').html(data);
|
||||
$('.budget-chart-activate').on('click', clickBudgetChart);
|
||||
}
|
||||
|
||||
function failBudgetOverview() {
|
||||
"use strict";
|
||||
console.log('Fail budget overview data!');
|
||||
$('#budgetOverview').removeClass('loading').addClass('general-chart-error');
|
||||
}
|
||||
|
||||
|
||||
|
||||
function drawChart() {
|
||||
"use strict";
|
||||
@@ -17,7 +38,7 @@ function drawChart() {
|
||||
columnChart('chart/report/in-out/' + reportType + '/' + startDate + '/' + endDate + '/' + accountIds, 'income-expenses-chart');
|
||||
columnChart('chart/report/in-out-sum/' + reportType + '/' + startDate + '/' + endDate + '/' + accountIds, 'income-expenses-sum-chart');
|
||||
|
||||
$('.budget-chart-activate').on('click', clickBudgetChart);
|
||||
|
||||
}
|
||||
|
||||
function clickBudgetChart(e) {
|
||||
|
||||
Reference in New Issue
Block a user