Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 1b585e5

Browse files
committed
Properly dispatch upload events for onload and onerror
FIX #22
1 parent c31bb88 commit 1b585e5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

dist/uploader.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* angular-ui-uploader
33
* https://github.com/angular-ui/ui-uploader
4-
* Version: 1.1.3 - 2015-12-01T00:54:49.732Z
4+
* Version: 1.1.3 - 2016-10-14T09:15:10.906Z
55
* License: MIT
66
*/
77

@@ -123,7 +123,7 @@ function uiUploader($log) {
123123
};
124124

125125
// Triggered when upload is completed:
126-
xhr.onload = function() {
126+
xhr.upload.onload = function() {
127127
self.activeUploads -= 1;
128128
self.uploadedFiles += 1;
129129
startUpload(self.options);
@@ -139,7 +139,7 @@ function uiUploader($log) {
139139
};
140140

141141
// Triggered when upload fails:
142-
xhr.onerror = function(e) {
142+
xhr.upload.onerror = function(e) {
143143
if (angular.isFunction(self.options.onError)) {
144144
self.options.onError(e);
145145
}

dist/uploader.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/uploader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function uiUploader($log) {
113113
};
114114

115115
// Triggered when upload is completed:
116-
xhr.onload = function() {
116+
xhr.upload.onload = function() {
117117
self.activeUploads -= 1;
118118
self.uploadedFiles += 1;
119119
startUpload(self.options);
@@ -129,7 +129,7 @@ function uiUploader($log) {
129129
};
130130

131131
// Triggered when upload fails:
132-
xhr.onerror = function(e) {
132+
xhr.upload.onerror = function(e) {
133133
if (angular.isFunction(self.options.onError)) {
134134
self.options.onError(e);
135135
}

0 commit comments

Comments
 (0)