Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jquery.filedrop.js compatible with jQuery 3.4.1 #191

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions jquery.filedrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
;(function($) {

var default_opts = {
fallback_id: '',
fallback_dropzoneClick : true,
fallback_id: '', // if this opt is set then change fallback_dropzoneClick to true
fallback_dropzoneClick : false, // change to false because if fallback_id is '' by default
url: '',
refresh: 1000,
paramname: 'userfile',
Expand Down Expand Up @@ -95,15 +95,16 @@
$('#' + opts.fallback_id).trigger(e);
});
}
}

$('#' + opts.fallback_id).change(function(e) {
opts.drop(e);
files = e.target.files;
files_count = files.length;
upload();
});


$('#' + opts.fallback_id).change(function(e) { // This generate the error "Syntax error, unrecognized expression: #"
opts.drop(e); // in newer versions of jQuery. Solved moving line 98 to 106 :)
files = e.target.files;
files_count = files.length;
upload();
});

} // Moved here from line 98

function drop(e) {
if( opts.drop.call(this, e) === false ) return false;
if(!e.originalEvent.dataTransfer)
Expand Down