From c592d5926c9dc39b0d9d3bb1bd37f487a5c12360 Mon Sep 17 00:00:00 2001 From: Peter Grassberger Date: Fri, 19 Feb 2016 00:56:32 +0100 Subject: importer: fix error on upload cancel bug diff --git a/www/js/importer.js b/www/js/importer.js index fbf4955..405c7fd 100644 --- a/www/js/importer.js +++ b/www/js/importer.js @@ -72,7 +72,6 @@ Rivendell.Importer.prototype.openModal = function(group, groupView, createCart, }; Rivendell.Importer.prototype.cancelAllUploads = function() { - var self = this; $.each(this.uploads, function(index, upload){ upload.cancel(); }); @@ -102,7 +101,8 @@ Rivendell.Upload = function(group, groupView, createCart, newCartNumber, useMeta }; Rivendell.Upload.prototype.cancel = function() { - this.dropzone.removeAllFiles(); + this.dropzone.off(Dropzone.ERROR); + this.dropzone.removeAllFiles(true); this.dropzone.disable(); var self = this; @@ -127,10 +127,10 @@ Rivendell.Upload.prototype.import = function() { this.dropzone.off('uploadprogress').on('uploadprogress', function(file) { self.groupView.uploadProgress(self, file); }); - this.dropzone.off('success').on('success', function(file) { + this.dropzone.off(Dropzone.SUCCESS).on(Dropzone.SUCCESS, function(file) { self.importFileUploadSuccess(); }); - this.dropzone.off('error').on('error', function(file, msg, xhr) { + this.dropzone.off(Dropzone.ERROR).on(Dropzone.ERROR, function(file, msg, xhr) { self.importFileUploadError(file, msg, xhr); }); // debug @@ -159,7 +159,8 @@ Rivendell.Upload.prototype.addCart = function(success) { }; Rivendell.Upload.prototype.importFileUploadSuccess = function() { - this.dropzone.removeAllFiles(); + this.dropzone.off(Dropzone.ERROR); + this.dropzone.removeAllFiles(true); this.dropzone.disable(); this.group.fetchCarts(); -- cgit v0.10.2