Tweak reports.

This commit is contained in:
James Cole
2016-10-26 19:45:10 +02:00
parent 5db4f8512b
commit afdcfa8525
6 changed files with 160 additions and 82 deletions

View File

@@ -1,4 +1,4 @@
/* globals google, startDate ,reportURL, endDate , reportType ,accountIds, lineChart, categoryReportUrl */
/* globals google, startDate ,reportURL, endDate , reportType ,accountIds, lineChart, categoryReportUrl, balanceReportUrl */
$(function () {
@@ -6,6 +6,7 @@ $(function () {
drawChart();
loadCategoryReport();
loadBalanceReport();
});
function loadCategoryReport() {
@@ -14,6 +15,19 @@ function loadCategoryReport() {
$.get(categoryReportUrl).done(placeCategoryReport).fail(failCategoryReport);
}
function loadBalanceReport() {
"use strict";
console.log('Going to grab ' + categoryReportUrl);
$.get(balanceReportUrl).done(placeBalanceReport).fail(failBalanceReport);
}
function placeBalanceReport(data) {
"use strict";
$('#balanceReport').removeClass('loading').html(data);
listLengthInitial();
triggerInfoClick();
}
function placeCategoryReport(data) {
"use strict";
$('#categoryReport').removeClass('loading').html(data);
@@ -21,6 +35,12 @@ function placeCategoryReport(data) {
triggerInfoClick();
}
function failBalanceReport() {
"use strict";
console.log('Fail balance report data!');
$('#balanceReport').removeClass('loading').addClass('general-chart-error');
}
function failCategoryReport() {
"use strict";
console.log('Fail category report data!');