Skip to content

Commit

Permalink
fixed #284
Browse files Browse the repository at this point in the history
  • Loading branch information
Danial Farid authored and Danial Farid committed Jul 29, 2014
1 parent 8cf9b7a commit c3278b3
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 30 deletions.
3 changes: 2 additions & 1 deletion demo/war/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" href="common.css">
<title>Angular file upload sample</title>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript">
FileAPI = {
debug: true,
//debug: true,
//forceLoad: true, html5: false //to debug flash in HTML5 browsers
//wrapInsideDiv: true, //experimental for fixing css issues
//only one of jsPath or jsUrl.
Expand Down
12 changes: 2 additions & 10 deletions demo/war/js/angular-file-upload-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,7 @@ if (!window.FormData || (window.FileAPI && FileAPI.forceLoad)) {
(evt.__files_ || evt.target.files).item = function(i) {
return (evt.__files_ || evt.target.files)[i] || null;
}
if (fn) {
fn.apply(this, [evt]);
} else {
// fix for #281 jQuery on IE8
var handlers = jQuery._data(this, "events").change;
for (var i = 1; i < handlers.length; i++) {
handlers[i].handler.apply(this, [evt]);
}
}
if (fn) fn.apply(this, [evt]);
};
};
var isFileChange = function(elem, e) {
Expand All @@ -225,7 +217,7 @@ if (!window.FormData || (window.FileAPI && FileAPI.forceLoad)) {
return function(e, fn) {
if (isFileChange(this, e)) {
addFlash(this);
if (jQuery) {
if (window.jQuery) {
// fix for #281 jQuery on IE8
angular.element(this).bind("change", changeFnWrapper(null));
} else {
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-file-upload-html5-shim.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**!
* AngularJS file upload shim for angular XHR HTML5 browsers
* @author Danial <danial.farid@gmail.com>
* @version 1.6.3
* @version 1.6.4
*/
if (window.XMLHttpRequest) {
if (window.FormData) {
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-file-upload-html5-shim.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 3 additions & 11 deletions dist/angular-file-upload-shim.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**!
* AngularJS file upload shim for HTML5 FormData
* @author Danial <danial.farid@gmail.com>
* @version 1.6.3
* @version 1.6.4
*/
(function() {

Expand Down Expand Up @@ -194,15 +194,7 @@ if (!window.FormData || (window.FileAPI && FileAPI.forceLoad)) {
(evt.__files_ || evt.target.files).item = function(i) {
return (evt.__files_ || evt.target.files)[i] || null;
}
if (fn) {
fn.apply(this, [evt]);
} else {
// fix for #281 jQuery on IE8
var handlers = jQuery._data(this, "events").change;
for (var i = 1; i < handlers.length; i++) {
handlers[i].handler.apply(this, [evt]);
}
}
if (fn) fn.apply(this, [evt]);
};
};
var isFileChange = function(elem, e) {
Expand All @@ -225,7 +217,7 @@ if (!window.FormData || (window.FileAPI && FileAPI.forceLoad)) {
return function(e, fn) {
if (isFileChange(this, e)) {
addFlash(this);
if (jQuery) {
if (window.jQuery) {
// fix for #281 jQuery on IE8
angular.element(this).bind("change", changeFnWrapper(null));
} else {
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-file-upload-shim.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/angular-file-upload.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**!
* AngularJS file upload/drop directive with http post and progress
* @author Danial <danial.farid@gmail.com>
* @version 1.6.3
* @version 1.6.4
*/
(function() {

Expand Down
Loading

0 comments on commit c3278b3

Please sign in to comment.