Merge pull request #520 from mozilla/i519

fix drag & drop
This commit is contained in:
Danny Coates 2017-08-16 11:11:46 -07:00 committed by GitHub
commit 3e066258c4
1 changed files with 4 additions and 4 deletions

View File

@ -34,13 +34,13 @@ async function upload(event) {
let file = ''; let file = '';
if (clickOrDrop === 'drop') { if (clickOrDrop === 'drop') {
if (!event.originalEvent.dataTransfer.files[0]) { if (!event.dataTransfer.files[0]) {
uploadWindow.classList.remove('ondrag'); uploadWindow.classList.remove('ondrag');
return; return;
} }
if ( if (
event.originalEvent.dataTransfer.files.length > 1 || event.dataTransfer.files.length > 1 ||
event.originalEvent.dataTransfer.files[0].size === 0 event.dataTransfer.files[0].size === 0
) { ) {
uploadWindow.classList.remove('ondrag'); uploadWindow.classList.remove('ondrag');
document.l10n.formatValue('uploadPageMultipleFilesAlert').then(str => { document.l10n.formatValue('uploadPageMultipleFilesAlert').then(str => {
@ -48,7 +48,7 @@ async function upload(event) {
}); });
return; return;
} }
file = event.originalEvent.dataTransfer.files[0]; file = event.dataTransfer.files[0];
} else { } else {
file = event.target.files[0]; file = event.target.files[0];
} }