diff options
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/importer.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/www/js/importer.js b/www/js/importer.js index 06caa1c..c5b48df 100644 --- a/www/js/importer.js +++ b/www/js/importer.js @@ -55,6 +55,12 @@ Rivendell.Importer.prototype.openModal = function(group, groupView, createCart, autoProcessQueue: false }); + this.$el.off('hide.bs.modal').on('hide.bs.modal', function() { + dropzone.removeAllFiles(true); + dropzone.disable(); + dropzone.destroy(); + }); + var self = this; dropzone.on('addedfile', function(file) { if (!Dropzone.isValidFile(file, dropzone.options.acceptedFiles)) { @@ -71,10 +77,12 @@ Rivendell.Importer.prototype.openModal = function(group, groupView, createCart, var upload = new Rivendell.Upload(group, groupView, createCart, newCartNumber, useMetadata, dropzone); self.uploads.push(upload); + self.$el.off('hide.bs.modal'); self.$el.modal('hide'); }) .removeAttr('disabled').focus(); }); + this.$el.modal({keyboard: true}); }; @@ -113,6 +121,7 @@ Rivendell.Upload.prototype.cancel = function() { this.dropzone.off(Dropzone.ERROR); this.dropzone.removeAllFiles(true); this.dropzone.disable(); + this.dropzone.destroy(); var self = this; if (this.createCart && this.cart !== null) { @@ -172,10 +181,10 @@ Rivendell.Upload.prototype.importFileUploadSuccess = function() { this.dropzone.off(Dropzone.ERROR); this.dropzone.removeAllFiles(true); this.dropzone.disable(); + this.dropzone.destroy(); + importer.removeUpload(this); this.group.fetchCarts(); - - importer.removeUpload(this); }; Rivendell.Upload.prototype.importFileUploadError = function(file, msg, xhr) { |