Use on instead of bind

Suggested by deepcode.ai.
This commit is contained in:
Marc Hartmayer 2020-05-24 12:46:39 +02:00
parent b2fee6a6c1
commit 52d633ca69
2 changed files with 3 additions and 3 deletions

View file

@ -39,8 +39,8 @@
};
return this.each(function() {
const element = this;
$(element).bind('dragenter dragover dragleave', stopFn);
return $(element).bind('drop', function(event) {
$(element).on('dragenter dragover dragleave', stopFn);
return $(element).on('drop', function(event) {
stopFn(event);
const files = event.dataTransfer.files;
for (let i = 0; i < files.length; i++) {