Skip to content

Commit 641f6a8

Browse files
committed
progress fix for angular 1.0.7
1 parent 1da122f commit 641f6a8

12 files changed

+29
-17
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angularjs-file-upload",
33
"main": "angular-file-upload.min.js",
4-
"version": "1.2.0",
4+
"version": "1.2.1",
55
"homepage": "https://github.com/danialfarid/angular-file-upload",
66
"authors": [
77
"Danial Farid <danial.farid@gmail.com>"

demo/war/js/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.0
4+
* @version 1.2.1
55
*/
66
if (window.XMLHttpRequest) {
77
if (window.FormData) {

demo/war/js/angular-file-upload-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 HTML5 FormData
33
* @author Danial <danial.farid@gmail.com>
4-
* @version 1.2.0
4+
* @version 1.2.1
55
*/
66
(function() {
77

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**!
22
* AngularJS file upload/drop directive with http post and progress
33
* @author Danial <danial.farid@gmail.com>
4-
* @version 1.2.0
4+
* @version 1.2.1
55
*/
66
(function() {
77

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

Lines changed: 6 additions & 2 deletions
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.0
4+
* @version 1.2.1
55
*/
66
if (window.XMLHttpRequest) {
77
if (window.FormData) {
@@ -12,7 +12,11 @@ if (window.XMLHttpRequest) {
1212
xhr.setRequestHeader = (function(orig) {
1313
return function(header, value) {
1414
if (header === '__setXHR_') {
15-
value(xhr);
15+
var val = value(xhr);
16+
// fix for angular < 1.2.0
17+
if (val instanceof Function) {
18+
val(xhr);
19+
}
1620
} else {
1721
orig.apply(xhr, arguments);
1822
}

dist/angular-file-upload-html5-shim.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.

dist/angular-file-upload-shim.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**!
22
* AngularJS file upload shim for HTML5 FormData
33
* @author Danial <danial.farid@gmail.com>
4-
* @version 1.2.0
4+
* @version 1.2.1
55
*/
66
(function() {
77

@@ -14,7 +14,11 @@ if (window.XMLHttpRequest) {
1414
xhr.setRequestHeader = (function(orig) {
1515
return function(header, value) {
1616
if (header === '__setXHR_') {
17-
value(xhr);
17+
var val = value(xhr);
18+
// fix for angular < 1.2.0
19+
if (val instanceof Function) {
20+
val(xhr);
21+
}
1822
} else {
1923
orig.apply(xhr, arguments);
2024
}
@@ -63,7 +67,11 @@ if (window.XMLHttpRequest) {
6367
xhr.setRequestHeader = (function(orig) {
6468
return function(header, value) {
6569
if (header === '__setXHR_') {
66-
value(xhr);
70+
var val = value(xhr);
71+
// fix for angular < 1.2.0
72+
if (val instanceof Function) {
73+
val(xhr);
74+
}
6775
} else {
6876
orig.apply(xhr, arguments);
6977
}

dist/angular-file-upload-shim.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.

dist/angular-file-upload.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**!
22
* AngularJS file upload/drop directive with http post and progress
33
* @author Danial <danial.farid@gmail.com>
4-
* @version 1.2.0
4+
* @version 1.2.1
55
*/
66
(function() {
77

dist/angular-file-upload.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)