From 3c8cdbc7dfb99e0a62d7837a5f27539c3a4f3010 Mon Sep 17 00:00:00 2001 From: Daniela Arcese Date: Wed, 19 Jul 2017 14:06:35 -0400 Subject: [PATCH] only allow drag and drop on upload page --- frontend/src/upload.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/frontend/src/upload.js b/frontend/src/upload.js index c8e2f3a2..d9dbdaf8 100644 --- a/frontend/src/upload.js +++ b/frontend/src/upload.js @@ -93,6 +93,8 @@ $(document).ready(function() { $('#page-one').hide(); $('#upload-error').hide(); $('#upload-progress').show(); + //don't allow drag and drop when not on page-one + $('body').off('drop', onUpload); const percent = progress[0] / progress[1]; // update progress bar $('#ul-progress').circleProgress('value', percent); @@ -101,21 +103,15 @@ $(document).ready(function() { }); if (progress[1] < 1000000) { $('.progress-text').text( - `${file.name} (${(progress[0] / 1000).toFixed( - 1 - )}KB of ${(progress[1] / 1000).toFixed(1)}KB)` + `${file.name} (${(progress[0] / 1000).toFixed(1)}KB of ${(progress[1] / 1000).toFixed(1)}KB)` ); } else if (progress[1] < 1000000000) { $('.progress-text').text( - `${file.name} (${(progress[0] / 1000000).toFixed( - 1 - )}MB of ${(progress[1] / 1000000).toFixed(1)}MB)` + `${file.name} (${(progress[0] / 1000000).toFixed(1)}MB of ${(progress[1] / 1000000).toFixed(1)}MB)` ); } else { $('.progress-text').text( - `${file.name} (${(progress[0] / 1000000).toFixed( - 1 - )}MB of ${(progress[1] / 1000000000).toFixed(1)}GB)` + `${file.name} (${(progress[0] / 1000000).toFixed(1)}MB of ${(progress[1] / 1000000000).toFixed(1)}GB)` ); } });