Skip to content

Commit

Permalink
Updating error display of max folder size
Browse files Browse the repository at this point in the history
  • Loading branch information
nWidart committed Sep 10, 2017
1 parent ab05719 commit 3190e06
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Modules/Media/Assets/js/init-dropzone.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ $( document ).ready(function() {
}
});
myDropzone.on("error", function(file, errorMessage) {
var html = '<div class="alert alert-danger" role="alert">' + errorMessage + '</div>';
let html;
if (typeof(errorMessage) === 'object') {
html = '<div class="alert alert-danger" role="alert">' + errorMessage.errors.file.join(', ') + '</div>';
} else {
html = '<div class="alert alert-danger" role="alert">' + errorMessage + '</div>';
}
$('.col-md-12').first().prepend(html);
setTimeout(function() {
myDropzone.removeFile(file);
Expand Down
7 changes: 6 additions & 1 deletion public/modules/media/js/init-dropzone.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ $( document ).ready(function() {
}
});
myDropzone.on("error", function(file, errorMessage) {
var html = '<div class="alert alert-danger" role="alert">' + errorMessage + '</div>';
let html;
if (typeof(errorMessage) === 'object') {
html = '<div class="alert alert-danger" role="alert">' + errorMessage.errors.file.join(', ') + '</div>';
} else {
html = '<div class="alert alert-danger" role="alert">' + errorMessage + '</div>';
}
$('.col-md-12').first().prepend(html);
setTimeout(function() {
myDropzone.removeFile(file);
Expand Down

0 comments on commit 3190e06

Please sign in to comment.