Skip to content

Commit

Permalink
More fixes for drag/drop behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Jul 14, 2014
1 parent b232b05 commit 2ef2a66
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions imp/js/draghandler.js
Expand Up @@ -19,7 +19,8 @@ var DragHandler = {
{
return (e.dataTransfer &&
e.dataTransfer.types &&
$A(e.dataTransfer.types).include('Files'));
$A(e.dataTransfer.types).include('Files') &&
((e.type != 'drop') || e.dataTransfer.files.length));
},

handleObserve: function(e)
Expand Down Expand Up @@ -56,7 +57,10 @@ var DragHandler = {
this.dropelt.fire('DragHandler:drop', e.dataTransfer.files);
}
e.stop();
} else if (!e.findElement('TEXTAREA') && !e.findElement('INPUT')) {
e.stop();
}

this.leave = true;
this.hide();
},
Expand Down Expand Up @@ -93,7 +97,8 @@ var DragHandler = {
e.stop();
} else {
this.dropelt.removeClassName(this.hoverclass);
if (Prototype.Browser.IE) {
if (Prototype.Browser.IE ||
Prototype.Browser.Gecko) {
e.stop();
}
}
Expand Down

0 comments on commit 2ef2a66

Please sign in to comment.