Skip to content

Commit 7de39ed

Browse files
committed
Fixed danialfarid#109 angular 1.2.8 shim success callback
1 parent 0cf8369 commit 7de39ed

16 files changed

+18
-15
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
##1.2.5
4+
Fixed #109 Angular 1.2.8 Data returned in success callback is null/undefined
5+
36
##1.2.4
47
Fixed #100 Custom names when uploading multiple files
58

-30.2 MB
Binary file not shown.
12 MB
Binary file not shown.
6.65 MB
Binary file not shown.
-3.51 MB
Binary file not shown.
-6.8 KB
Binary file not shown.
6.9 KB
Binary file not shown.

demo/war/js/angular-file-upload-shim.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ if (window.XMLHttpRequest) {
8585
url: xhr.__url,
8686
complete: function(err, fileApiXHR) {
8787
xhr.__load({type: 'load', loaded: xhr.__total, total: xhr.__total, target: xhr, lengthComputable: true});
88-
Object.defineProperty(xhr, 'status', {get: function() {return fileApiXHR.status}});
89-
Object.defineProperty(xhr, 'statusText', {get: function() {return fileApiXHR.statusText}});
88+
if (fileApiXHR.status !== undefined) Object.defineProperty(xhr, 'status', {get: function() {return fileApiXHR.status}});
89+
if (fileApiXHR.statusText !== undefined) Object.defineProperty(xhr, 'statusText', {get: function() {return fileApiXHR.statusText}});
9090
Object.defineProperty(xhr, 'readyState', {get: function() {return 4}});
91-
Object.defineProperty(xhr, 'response', {get: function() {return fileApiXHR.response}});
91+
if (fileApiXHR.response !== undefined) Object.defineProperty(xhr, 'response', {get: function() {return fileApiXHR.response}});
9292
Object.defineProperty(xhr, 'responseText', {get: function() {return fileApiXHR.responseText}});
9393
xhr.__fileApiXHR = fileApiXHR;
9494
xhr.onreadystatechange();

dist/angular-file-upload-html5-shim.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**!
22
* AngularJS file upload shim for angular XHR HTML5 browsers
33
* @author Danial <danial.farid@gmail.com>
4-
* @version 1.2.4
4+
* @version 1.2.5
55
*/
66
if (window.XMLHttpRequest) {
77
if (window.FormData) {

dist/angular-file-upload-html5-shim.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)