Created
July 18, 2014 10:59
-
-
Save nitinhayaran/54f69629ef13e579cb58 to your computer and use it in GitHub Desktop.
Test if dragenter/dragover event contains files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function containsFiles(event) { | |
if (event.dataTransfer.types) { | |
for (var i = 0; i < event.dataTransfer.types.length; i++) { | |
if (event.dataTransfer.types[i] == "Files") { | |
return true; | |
} | |
} | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment