diff --git a/TODO.md b/TODO.md index 6419c8b..837b6a5 100644 --- a/TODO.md +++ b/TODO.md @@ -3,7 +3,6 @@ - Dot support - hot keys for InfoPage - drug and drop directory -- multiple files upload - Download project button - switch monaco themes ? platform.yml diff --git a/src/app.js b/src/app.js index 56863e0..8fd9a01 100644 --- a/src/app.js +++ b/src/app.js @@ -139,8 +139,10 @@ $(async () => { }); // Drag and Drop - new DnDFileController(async (file) => { - await leftCollection.addPageFromFile(file); + new DnDFileController(async (files) => { + for (let file of files) { + await leftCollection.addPageFromFile(file); + } }); // add file or template to left panel @@ -149,10 +151,11 @@ $(async () => { let value = evt.target.value; evt.target.value = ''; if (value==='loadFile') { // from file - $('') + $('') .on('change', async (evt) => { - let file = $(evt.target)[0].files[0]; - await leftCollection.addPageFromFile(file); + for (let file of $(evt.target)[0].files) { + await leftCollection.addPageFromFile(file); + } }) .click(); } else { // from template diff --git a/src/drug-and-drop.js b/src/drug-and-drop.js index 62cff67..840889e 100644 --- a/src/drug-and-drop.js +++ b/src/drug-and-drop.js @@ -31,7 +31,7 @@ export default function DnDFileController(onDropCallback) { //el_.classList.remove('dropping'); m.style.display = 'none'; - onDropCallback(evt.dataTransfer.files[0]); + onDropCallback(evt.dataTransfer.files); }; el_.addEventListener('dragenter', this.dragenter, false);