mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-03 11:08:28 +00:00
Allow report options to be pulled using AJAX. Ajax is cool.
This commit is contained in:
@@ -44,9 +44,24 @@ $(function () {
|
||||
|
||||
$('.date-select').on('click', preSelectDate);
|
||||
$('#report-form').on('submit', catchSubmit);
|
||||
$('select[name="report_type"]').on('change', getReportOptions);
|
||||
getReportOptions();
|
||||
|
||||
});
|
||||
|
||||
function getReportOptions() {
|
||||
"use strict";
|
||||
var reportType = $('select[name="report_type"]').val();
|
||||
$('#extra-options').empty();
|
||||
$('#extra-options').addClass('loading');
|
||||
console.log('Changed report type to ' + reportType);
|
||||
$.getJSON('reports/options/' + reportType, function(data) {
|
||||
$('#extra-options').removeClass('loading').html(data.html);
|
||||
}).fail(function(){
|
||||
$('#extra-options').removeClass('loading').addClass('error');
|
||||
});
|
||||
}
|
||||
|
||||
function catchSubmit() {
|
||||
"use strict";
|
||||
// default;20141201;20141231;4;5
|
||||
|
Reference in New Issue
Block a user