Upload errors show up and can be closed properly

This commit is contained in:
HugoNeveux 2020-04-27 19:00:49 +02:00
parent f7e92f81af
commit dfcecd47e0

View File

@ -66,8 +66,10 @@ $('#multiFileUpload').dropzone({
let res = eval('(' + data.xhr.responseText + ')'); let res = eval('(' + data.xhr.responseText + ')');
}); });
this.on("error", function(file, message) { this.on("error", function(file, message) {
$('.alert').html(''); if ($('#errorMsg').length > 0) {
$('#errorZone').append(message.error); $('#errorMsg').remove();
}
$('#errorZone').append(`<span id="errorMsg">${message.error}</span>`);
$('#errorZone').show(); $('#errorZone').show();
}); });
this.on('sending', function(file, xhr, formData) { this.on('sending', function(file, xhr, formData) {