mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-26 13:36:15 +00:00
Multi year report move to AJAX.
Signed-off-by: James Cole <thegrumpydictator@gmail.com>
This commit is contained in:
@@ -128,4 +128,33 @@ function respondInfoButton(data) {
|
||||
$('#defaultModal').empty().html(data.html);
|
||||
$('#defaultModal').modal('show');
|
||||
|
||||
}
|
||||
|
||||
function loadAjaxPartial(holder, uri) {
|
||||
"use strict";
|
||||
console.log('Going to grab URI ' + uri);
|
||||
$.get(uri).done(function (data) {
|
||||
displayAjaxPartial(data, holder);
|
||||
}).fail(function () {
|
||||
failAjaxPartial(uri, holder);
|
||||
});
|
||||
}
|
||||
|
||||
function displayAjaxPartial(data, holder) {
|
||||
"use strict";
|
||||
console.log('Display stuff in ' + holder);
|
||||
var obj = $('#' + holder);
|
||||
obj.removeClass('loading').html(data);
|
||||
|
||||
// call some often needed recalculations and what-not:
|
||||
|
||||
// find a sortable table and make it sortable:
|
||||
$.bootstrapSortable(true);
|
||||
}
|
||||
|
||||
function failAjaxPartial(uri, holder) {
|
||||
"use strict";
|
||||
console.log('Failed to load' + uri);
|
||||
$('#' + holder).removeClass('loading').addClass('general-chart-error');
|
||||
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
/* globals google, startDate ,reportURL, endDate , reportType ,accountIds , picker:true, minDate, year, month, columnChart, lineChart, stackedColumnChart */
|
||||
/* globals budgetMultiUrl, accountIds */
|
||||
|
||||
|
||||
$(function () {
|
||||
"use strict";
|
||||
drawChart();
|
||||
|
||||
loadAjaxPartial('budgetMultiYear', budgetMultiUrl);
|
||||
});
|
||||
|
||||
|
||||
function drawChart() {
|
||||
"use strict";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user