make alert show when uploading a folder

This commit is contained in:
Daniela Arcese 2017-07-20 10:31:39 -04:00
parent 80cf343516
commit 60bfd1b67c

View File

@ -19,7 +19,6 @@ $(document).ready(function() {
$('#link').attr('disabled', false); $('#link').attr('disabled', false);
$copyBtn.attr('data-l10n-id', 'copyUrlFormButton'); $copyBtn.attr('data-l10n-id', 'copyUrlFormButton');
if (localStorage.length === 0) { if (localStorage.length === 0) {
toggleHeader(); toggleHeader();
} else { } else {
@ -72,7 +71,8 @@ $(document).ready(function() {
event.preventDefault(); event.preventDefault();
let file = ''; let file = '';
if (event.type === 'drop') { if (event.type === 'drop') {
if (event.originalEvent.dataTransfer.files.length > 1){ if (event.originalEvent.dataTransfer.files.length > 1 || event.originalEvent.dataTransfer.files[0].size === 0){
$('.upload-window').removeClass('ondrag');
document.l10n.formatValue('uploadPageMultipleFilesAlert') document.l10n.formatValue('uploadPageMultipleFilesAlert')
.then(str => { .then(str => {
alert(str); alert(str);
@ -169,7 +169,7 @@ $(document).ready(function() {
$('#upload-progress').attr('hidden', true); $('#upload-progress').attr('hidden', true);
$('#upload-error').attr('hidden', true); $('#upload-error').attr('hidden', true);
$('#share-link').removeAttr('hidden'); $('#share-link').removeAttr('hidden');
}, 2000); }, 1000);
populateFileList(JSON.stringify(fileData)); populateFileList(JSON.stringify(fileData));
document.l10n.formatValue('notifyUploadDone') document.l10n.formatValue('notifyUploadDone')