summaryrefslogtreecommitdiff
path: root/www/static/js/dropzone.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/static/js/dropzone.js')
-rw-r--r--www/static/js/dropzone.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/www/static/js/dropzone.js b/www/static/js/dropzone.js
index bfc5c1a..f4e3399 100644
--- a/www/static/js/dropzone.js
+++ b/www/static/js/dropzone.js
@@ -14,7 +14,12 @@ var vfs_upload_queue = [];
e.preventDefault();
var dropzone = document.getElementById("dropzone");
dropzone.style.backgroundColor = "white";
- for(file of e.dataTransfer.files){
+ addToUploadQueue(e.dataTransfer.files);
+
+ }
+
+ function addToUploadQueue(files){
+ for(file of files){
try {
reader = new FileReader();
reader.readAsBinaryString(file);
@@ -78,12 +83,10 @@ var vfs_upload_queue = [];
xhr.onreadystatechange=function(){
if (xhr.readyState==4 && xhr.status==200){
- document.getElementById("upload-message").innerHTML = xhr.responseText;
}
};
xhr.upload.addEventListener("progress", function(e){
-
document.getElementById("progressBar-"+this.filename).value = Math.ceil(e.loaded/e.total)*100;
});
xhr.send(data);