summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Grassberger <petertheone@gmail.com>2016-02-18 23:56:32 (GMT)
committerPeter Grassberger <petertheone@gmail.com>2016-02-18 23:56:32 (GMT)
commitc592d5926c9dc39b0d9d3bb1bd37f487a5c12360 (patch)
tree37691d8999d4aabb712098d4d3faef0e33f3b07d
parenta811d28ec819d4cff0b51aecc9fdbfd5c74ec746 (diff)
importer: fix error on upload cancel bug
-rw-r--r--www/js/importer.js11
1 files changed, 6 insertions, 5 deletions
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();