Skip to content
Snippets Groups Projects
Commit 781e2fe8 authored by Jared Hancock's avatar Jared Hancock
Browse files

forms: Honor maxfiles setting

parent e9180f89
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,12 @@ ...@@ -35,6 +35,12 @@
this.$element.css('background-color', 'rgba(0, 0, 0, 0.3)'); this.$element.css('background-color', 'rgba(0, 0, 0, 0.3)');
}, },
beforeEach: function (file) { beforeEach: function (file) {
if (this.options.maxfiles && this.uploads.length >= this.options.maxfiles) {
// This file is not allowed to be added to the list. It's over the
// limit
this.handleError('TooManyFiles', file);
return false;
}
var node = this.addNode(file).data('file', file); var node = this.addNode(file).data('file', file);
node.find('.progress').show(); node.find('.progress').show();
node.find('.progress-bar').width('100%').addClass('progress-bar-striped active'); node.find('.progress-bar').width('100%').addClass('progress-bar-striped active');
...@@ -201,7 +207,8 @@ ...@@ -201,7 +207,8 @@
$.fn.filedropbox.defaults = { $.fn.filedropbox.defaults = {
files: [], files: [],
deletable: true, deletable: true,
shim: !window.FileReader shim: !window.FileReader,
queuefiles: 2
}; };
$.fn.filedropbox.messages = { $.fn.filedropbox.messages = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment