From 1d7d9eff254f7416254d83f78df9c3d82066fa97 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Sun, 4 Oct 2015 03:56:49 +0200 Subject: [PATCH] Fix bug on small files --- public/js/lufi-up.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/js/lufi-up.js b/public/js/lufi-up.js index 9b02580..0e73f36 100644 --- a/public/js/lufi-up.js +++ b/public/js/lufi-up.js @@ -116,7 +116,7 @@ function updateMailLink() { function handleFiles(f) { window.files = f; - var r = document.getElementById('results'); + var r = document.getElementById('results'); r.style.display = 'block'; var delay = document.getElementById('delete-day'); @@ -139,6 +139,9 @@ function uploadFile(i, delay, del_at_first_view) { var file = window.files[i]; var name = file.name; var parts = Math.ceil(file.size/window.sliceLength); + if (parts === 0) { + parts = 1; + } // Create a progress bar for the file var r = document.getElementById('ul-results');