mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-15 22:28:14 +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');
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user