mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-19 19:01:39 +00:00
Small cosmetic changes to export routine.
This commit is contained in:
18
public/js/ff/export/index.js
vendored
18
public/js/ff/export/index.js
vendored
@@ -58,7 +58,8 @@ function hideForm() {
|
||||
function showForm() {
|
||||
"use strict";
|
||||
$('#form-body').show();
|
||||
$('#do-export-button').show();
|
||||
$('#do-export-button').show().prop('disabled', false);
|
||||
// enable button again:
|
||||
}
|
||||
|
||||
function showLoading() {
|
||||
@@ -88,7 +89,7 @@ function callExport() {
|
||||
// call status, keep calling it until response is "finished"?
|
||||
intervalId = window.setInterval(checkStatus, 500);
|
||||
|
||||
$.post('export/submit', data).done(function () {
|
||||
$.post('export/submit', data, null, 'json').done(function () {
|
||||
// stop polling:
|
||||
window.clearTimeout(intervalId);
|
||||
|
||||
@@ -103,18 +104,13 @@ function callExport() {
|
||||
// show download
|
||||
showDownload();
|
||||
|
||||
}).fail(function (data) {
|
||||
}).fail(function (jqXHR, textStatus, errorThrown) {
|
||||
// show error.
|
||||
// show form again.
|
||||
|
||||
var response = jqXHR.responseJSON;
|
||||
var errorText = 'The export failed. Please check the log files to find out why.';
|
||||
if (typeof data.responseJSON === 'object') {
|
||||
errorText = '';
|
||||
for (var propt in data.responseJSON) {
|
||||
if (data.responseJSON.hasOwnProperty(propt)) {
|
||||
errorText += propt + ': ' + data.responseJSON[propt][0];
|
||||
}
|
||||
}
|
||||
if (typeof response === 'object') {
|
||||
errorText =response.message;
|
||||
}
|
||||
|
||||
showError(errorText);
|
||||
|
Reference in New Issue
Block a user