Merge #16363 - Fix #14795 - async Routine export list

Pull-request: #16363
Fixes: #14795
Fixes: #16264

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2020-10-06 10:54:27 +02:00
commit d5b07558bc
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889

View File

@ -131,23 +131,26 @@ RTE.COMMON = {
if (count === 0) {
Functions.ajaxShowMessage(Messages.NoExportable);
}
var p = $.when();
exportAnchors.each(function () {
$.get($(this).attr('href'), { 'ajax_request': true }, function (data) {
returnCount++;
if (data.success === true) {
combined.message += '\n' + data.message + '\n';
if (returnCount === count) {
showExport(combined);
var h = $(this).attr('href');
p = p.then(function () {
return $.get(h, { 'ajax_request': true }, function (data) {
returnCount++;
if (data.success === true) {
combined.message += '\n' + data.message + '\n';
if (returnCount === count) {
showExport(combined);
}
} else {
// complain even if one export is failing
combined.success = false;
combined.error += '\n' + data.error + '\n';
if (returnCount === count) {
showExport(combined);
}
}
} else {
// complain even if one export is failing
combined.success = false;
combined.error += '\n' + data.error + '\n';
if (returnCount === count) {
showExport(combined);
}
}
});
});
});
} else {