Skip to content

Commit

Permalink
BUGFIX: Bind event listeners to the manager not the dropzone.
Browse files Browse the repository at this point in the history
  • Loading branch information
curiosity26 committed Aug 10, 2017
1 parent 668bf66 commit 8224a14
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
32 changes: 16 additions & 16 deletions ng-batchupload.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,69 +111,69 @@ angular.module('batchUpload', [])
this.dropzone = new FileDropZone($element[0], settings);

if (!!this.buOnComplete) {
this.dropzone.on('complete', this.buOnComplete);
settings.manager.on('complete', this.buOnComplete);
}

if (!!this.buOnError) {
this.dropzone.on('error', this.buOnError);
settings.manager.on('error', this.buOnError);
}

if (!!this.buOnFileStart) {
this.dropzone.on('file_start', this.buOnFileStart);
settings.manager.on('file_start', this.buOnFileStart);
}

if (!!this.buOnStart) {
this.dropzone.on('start', this.buOnStart);
settings.manager.on('start', this.buOnStart);
}

if (!!this.buOnPause) {
this.dropzone.on('pause', this.buOnPause);
settings.manager.on('pause', this.buOnPause);
}

if (!!this.buOnProgress) {
this.dropzone.on('progress', this.buOnProgress);
settings.manager.on('progress', this.buOnProgress);
}

if (!!this.buOnInvalid) {
this.dropzone.on('invalud', this.buOnInvalid);
settings.manager.on('invalud', this.buOnInvalid);
}

if (!!this.buOnQueue) {
this.dropzone.on('queue', this.buOnQueue);
settings.manager.on('queue', this.buOnQueue);
}
};

this.$onDestroy = function() {
if (!!this.buOnComplete) {
this.dropzone.off('complete', this.buOnComplete);
settings.manager.off('complete', this.buOnComplete);
}

if (!!this.buOnError) {
this.dropzone.off('error', this.buOnError);
settings.manager.off('error', this.buOnError);
}

if (!!this.buOnFileStart) {
this.dropzone.off('file_start', this.buOnFileStart);
settings.manager.off('file_start', this.buOnFileStart);
}

if (!!this.buOnStart) {
this.dropzone.off('start', this.buOnStart);
settings.manager.off('start', this.buOnStart);
}

if (!!this.buOnPause) {
this.dropzone.off('pause', this.buOnPause);
settings.manager.off('pause', this.buOnPause);
}

if (!!this.buOnProgress) {
this.dropzone.off('progress', this.buOnProgress);
settings.manager.off('progress', this.buOnProgress);
}

if (!!this.buOnInvalid) {
this.dropzone.off('invalud', this.buOnInvalid);
settings.manager.off('invalud', this.buOnInvalid);
}

if (!!this.buOnQueue) {
this.dropzone.off('queue', this.buOnQueue);
settings.manager.off('queue', this.buOnQueue);
}
};
}],
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-batchupload",
"version": "1.1.1",
"version": "1.1.2",
"description": "A wrapper module to angular for the batchupload library",
"main": "ng-batchupload.js",
"scripts": {
Expand All @@ -25,6 +25,6 @@
},
"homepage": "https://github.com/curiosity26/angular-batchupload#readme",
"dependencies": {
"batchupload": "~1.0.6"
"batchupload": "^1.0.7"
}
}

0 comments on commit 8224a14

Please sign in to comment.