Skip to content

Commit

Permalink
Merge pull request #4719 from greezybacon/issue/jq-3-file-drop
Browse files Browse the repository at this point in the history
filedrop: Fix file drag and drop
  • Loading branch information
protich committed Feb 12, 2019
2 parents eebef63 + c2fdc0a commit 8d01b1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions js/filedrop.field.js
Expand Up @@ -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),
Expand All @@ -29,6 +30,9 @@
};

FileDropbox.prototype = {
dragLeave: function(e) {
this.$element.removeAttr('style');
},
drop: function(e) {
this.$element.removeAttr('style');
},
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion scp/js/scp.js
Expand Up @@ -1308,7 +1308,7 @@ jQuery(function($) {
$.fn.show = function() {
var argsArray = Array.prototype.slice.call(arguments),
arg = argsArray[0],
options = {};
options = argsArray[1] || {duration: 0};
if (typeof(arg) === 'number')
options.duration = arg;
else
Expand Down

0 comments on commit 8d01b1f

Please sign in to comment.