Skip to content

Commit

Permalink
Allow to define the dropEffect and preventDefault handling in the dra…
Browse files Browse the repository at this point in the history
…gover handler. Closes blueimp#2557
  • Loading branch information
blueimp committed Aug 30, 2013
1 parent 5b58416 commit e0a8dbd
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions js/jquery.fileupload.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* jQuery File Upload Plugin 5.32.4
* jQuery File Upload Plugin 5.32.5
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
Expand Down Expand Up @@ -1142,11 +1142,17 @@

_onDragOver: function (e) {
e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer;
var dataTransfer = e.dataTransfer;
var dataTransfer = e.dataTransfer,
data = {
dropEffect: 'copy',
preventDefault: true
};
if (dataTransfer && $.inArray('Files', dataTransfer.types) !== -1 &&
this._trigger('dragover', e) !== false) {
dataTransfer.dropEffect = 'copy';
e.preventDefault();
this._trigger('dragover', e, data) !== false) {
dataTransfer.dropEffect = data.dropEffect;
if (data.preventDefault) {
e.preventDefault();
}
}
},

Expand Down

0 comments on commit e0a8dbd

Please sign in to comment.