File Upload: Clear notifications before success/error

So we don't end up with both file-upload and success at the same time
when uploading files that go up fast.
This commit is contained in:
Pablo Vazquez 2017-10-11 23:08:20 +02:00
parent 7fd7fcc16c
commit 43cb7a5f65

View File

@ -114,6 +114,7 @@ function setup_file_uploader(index, upload_element) {
$('.node-edit-title').html(filename);
}
toastr.clear();
toastr.success('File uploaded!');
set_progress_bar(100);
@ -131,6 +132,7 @@ function setup_file_uploader(index, upload_element) {
uploadErrors.push(fileupload.messages[key]);
}
toastr.clear();
toastr.error(uploadErrors.join("; "), 'Upload error');
set_progress_bar(100, 'progress-error');