From 575f0c842194bb4011ea06a39dd55edcc89e1b50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Fri, 18 Aug 2017 15:18:20 +0200 Subject: [PATCH] Do not iterate over the files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As "singleFileUpload" is used the "add" callback (which in turn calls "addFileToUpload") will always be called with a single file. Therefore there is no need to iterate over the files (and it is not done in the other callbacks either, so this aligns the code with the rest of the callbacks). Signed-off-by: Daniel Calviño Sánchez --- apps/files_sharing/js/files_drop.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/files_sharing/js/files_drop.js b/apps/files_sharing/js/files_drop.js index 67c1bfb3b4a..8d1273f1872 100644 --- a/apps/files_sharing/js/files_drop.js +++ b/apps/files_sharing/js/files_drop.js @@ -63,11 +63,10 @@ $('#drop-upload-done-indicator').addClass('hidden'); $('#drop-upload-progress-indicator').removeClass('hidden'); - _.each(data['files'], function(file) { - $('#public-upload ul').append(output({isUploading: true, name: file.name})); - $('[data-toggle="tooltip"]').tooltip(); - data.submit(); - }); + + $('#public-upload ul').append(output({isUploading: true, name: data.files[0].name})); + $('[data-toggle="tooltip"]').tooltip(); + data.submit(); return true; },