Skip to content

Commit

Permalink
Merge pull request #156 from JulesDoe/master
Browse files Browse the repository at this point in the history
HTML5 dragleave fired when hovering a child element
  • Loading branch information
LPology committed Apr 4, 2016
2 parents c85ac4f + ef95ed6 commit 7f8a5a8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion SimpleAjaxUploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -1849,6 +1849,7 @@ ss.DragAndDrop = {

addDropZone: function( elem ) {
var self = this;
var depthCounter = 0;

ss.addStyles( elem, {
'zIndex': 16777271
Expand All @@ -1863,6 +1864,7 @@ ss.DragAndDrop = {
}

ss.addClass( this, self._opts.dragClass );
depthCounter++;
return false;
};

Expand All @@ -1878,7 +1880,10 @@ ss.DragAndDrop = {
};

elem.ondragleave = function() {
ss.removeClass( this, self._opts.dragClass );
depthCounter--;
if (depthCounter === 0){
ss.removeClass( this, self._opts.dragClass );
}
return false;
};

Expand Down

0 comments on commit 7f8a5a8

Please sign in to comment.