diff --git a/js/filedrop.field.js b/js/filedrop.field.js index 42b94e70fb3fb9add7f20417feaea2041e097436..ab5559af31f8f365d2bb9202ff5cef12dfbcb84c 100644 --- a/js/filedrop.field.js +++ b/js/filedrop.field.js @@ -11,6 +11,7 @@ progressUpdated: $.proxy(this.progressUpdated, this), speedUpdated: $.proxy(this.speedUpdated, this), dragOver: $.proxy(this.dragOver, this), + dragLeave: $.proxy(this.dragLeave, this), drop: $.proxy(this.drop, this), beforeSend: $.proxy(this.beforeSend, this), beforeEach: $.proxy(this.beforeEach, this), @@ -29,6 +30,9 @@ }; FileDropbox.prototype = { + dragLeave: function(e) { + this.$element.removeAttr('style'); + }, drop: function(e) { this.$element.removeAttr('style'); }, @@ -361,9 +365,9 @@ function drop(e) { if( opts.drop.call(this, e) === false ) return false; - if(!e.dataTransfer) + if(!e.originalEvent.dataTransfer) return; - files = e.dataTransfer.files; + files = e.originalEvent.dataTransfer.files; if (files === null || files === undefined || files.length === 0) { opts.error(errors[0]); return false;