summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2017-08-18 15:18:20 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2017-08-18 15:18:20 +0200
commit4d003c812de88c922ff9835d910e5a01b7bb0d28 (patch)
tree546f8fdbd0baac4ff6555fe66403e82ee31c1fe3
parent313b824dd73648e3f86c1547a811c857bebb5a6d (diff)
downloadnextcloud-server-4d003c812de88c922ff9835d910e5a01b7bb0d28.tar.gz
nextcloud-server-4d003c812de88c922ff9835d910e5a01b7bb0d28.zip
Do not iterate over the files
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 <danxuliu@gmail.com>
-rw-r--r--apps/files_sharing/js/files_drop.js9
1 files 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;
},