Skip to content

Commit

Permalink
fix non-files
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Apr 17, 2013
1 parent 91855a1 commit 5cd6df1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,23 @@ Dropload.prototype.ondrop = function(e){
/**
* Walk directories and upload files.
*
* Directories are considered "files",
* non-files return null for .webkitGetAsEntry()
* for example when dragging urls.
*
* @param {DataTransferItemList} items
* @api private
*/

Dropload.prototype.directories = function(items){
for (var i = 0; i < items.length; i++) {
var item = items[i];

if ('file' != item.kind) continue;

if (!item.webkitGetAsEntry) continue;
var entry = item.webkitGetAsEntry();

if (entry.isDirectory) {
this.ignore(entry.name);
this.walkEntry(entry);
Expand Down

0 comments on commit 5cd6df1

Please sign in to comment.