Merge pull request #294 from mozilla/invalidDragAndDrops

dealing with invalid drag and drops
This commit is contained in:
Danny Coates 2017-07-24 13:56:00 -07:00 committed by GitHub
commit 83880d97e6

View File

@ -143,6 +143,10 @@ $(document).ready(function() {
let file = '';
if (event.type === 'drop') {
if (!event.originalEvent.dataTransfer.files[0]) {
$('.upload-window').removeClass('ondrag');
return;
}
if (
event.originalEvent.dataTransfer.files.length > 1 ||
event.originalEvent.dataTransfer.files[0].size === 0