Skip to content

Commit

Permalink
fixed drop for IE, FF
Browse files Browse the repository at this point in the history
  • Loading branch information
danialfarid committed Mar 27, 2014
1 parent a08b2a5 commit 36541a0
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 18 deletions.
2 changes: 1 addition & 1 deletion demo/war/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ <h3>
</ul>
</div>
</div>
<div style="position:absolute;bottom:10px;right:10px;font-size:smaller;color:#777">Last update: 2014-03-24</div>
<div style="position:absolute;bottom:10px;right:10px;font-size:smaller;color:#777">Last update: 2014-03-27</div>
</body>
</html>
13 changes: 9 additions & 4 deletions demo/war/js/angular-file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,16 @@ angularFileUpload.directive('ngFileDrop', [ '$parse', '$timeout', function($pars
evt.preventDefault();
elem.removeClass(attr['ngFileDragOverClass'] || "dragover");
var files = [], items = evt.dataTransfer.items;
for (var i = 0; i < items.length; i++) {
if (items[i].webkitGetAsEntry) {
if (items && items.length > 0 && items[0].webkitGetAsEntry) {
for (var i = 0; i < items.length; i++) {
traverseFileTree(files, items[i].webkitGetAsEntry());
} else {
files.push(items[i]);
}
} else {
var fileList = evt.dataTransfer.files;
if (fileList != null) {
for (var i = 0; i < fileList.length; i++) {
files.push(fileList.item(i));
}
}
}
(function callback(delay) {
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.3.0
* @version 1.3.1
*/
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.

2 changes: 1 addition & 1 deletion 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.3.0
* @version 1.3.1
*/
(function() {

Expand Down
2 changes: 1 addition & 1 deletion dist/angular-file-upload-shim.min.js

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

15 changes: 10 additions & 5 deletions 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.3.0
* @version 1.3.1
*/
(function() {

Expand Down Expand Up @@ -208,11 +208,16 @@ angularFileUpload.directive('ngFileDrop', [ '$parse', '$timeout', function($pars
evt.preventDefault();
elem.removeClass(attr['ngFileDragOverClass'] || "dragover");
var files = [], items = evt.dataTransfer.items;
for (var i = 0; i < items.length; i++) {
if (items[i].webkitGetAsEntry) {
if (items && items.length > 0 && items[0].webkitGetAsEntry) {
for (var i = 0; i < items.length; i++) {
traverseFileTree(files, items[i].webkitGetAsEntry());
} else {
files.push(items[i]);
}
} else {
var fileList = evt.dataTransfer.files;
if (fileList != null) {
for (var i = 0; i < fileList.length; i++) {
files.push(fileList.item(i));
}
}
}
(function callback(delay) {
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-file-upload.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 nuget/Package.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata>
<id>angular-file-upload</id>
<title>Angular file upload</title>
<version>1.3.0</version>
<version>1.3.1</version>
<authors>Danial Farid, Georgios Diamantopoulos (nuget package)</authors>
<owners>Danial Farid</owners>
<licenseUrl>https://github.com/danialfarid/angular-file-upload/blob/master/LICENSE</licenseUrl>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-file-upload",
"version": "1.3.0",
"version": "1.3.1",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-uglify": "~0.2.7",
Expand Down

0 comments on commit 36541a0

Please sign in to comment.