Moved a report out of the controller.

This commit is contained in:
James Cole
2016-10-08 16:24:07 +02:00
parent a1f797c4d1
commit ea7ee7ee9a
9 changed files with 109 additions and 34 deletions

View File

@@ -17,8 +17,26 @@ $(function () {
// find the little info buttons and respond to them.
$('.firefly-info-button').click(clickInfoButton);
// load the account report, which this report shows:
loadAccountReport();
});
function loadAccountReport() {
"use strict";
$.get(accountReportUrl).done(placeAccountReport).fail(failAccountReport);
}
function placeAccountReport(data) {
"use strict";
$('#accountReport').removeClass('loading').html(data);
}
function failAccountReport(data) {
"use strict";
$('#accountReport').removeClass('loading').addClass('general-chart-error');
}
function clickInfoButton(e) {
"use strict";
// find all data tags, regardless of what they are: