summaryrefslogtreecommitdiffstats
path: root/apps/files/js/files.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-03-06 20:32:27 +0100
committerVincent Petry <pvince81@owncloud.com>2014-03-06 20:32:27 +0100
commitb4c10eea607c97d805bb658438df8f82487986b4 (patch)
treedf90c192bac836853700f41f707e3746c1d6e5d3 /apps/files/js/files.js
parentc358373dfa1e6c011a9ab7e1ce8aa48e8d15615f (diff)
downloadnextcloud-server-b4c10eea607c97d805bb658438df8f82487986b4.tar.gz
nextcloud-server-b4c10eea607c97d805bb658438df8f82487986b4.zip
Fixed "select all" + download on public page
When a user has lots of files, selecting all and downloading would send the whole list of files to the server. This fix makes it use the simpler default download URL in such cases (the one that was used by the "Download" button that is now removed on the public page)
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r--apps/files/js/files.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index b5633ae01aa..f39d9aa533c 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -350,7 +350,12 @@ $(document).ready(function() {
// use special download URL if provided, e.g. for public shared files
var downloadURL = document.getElementById("downloadURL");
if ( downloadURL ) {
- window.location = downloadURL.value+"&download&files=" + encodeURIComponent(fileslist);
+ // downloading all in root of public share ? (replacement for old "Download" button)
+ if ($('#isPublic').val() && dir === '/' && $('#select_all').is(':checked')) {
+ window.location = downloadURL.value;
+ } else {
+ window.location = downloadURL.value+"&download&files=" + encodeURIComponent(fileslist);
+ }
} else {
window.location = OC.filePath('files', 'ajax', 'download.php') + '?'+ $.param({ dir: dir, files: fileslist });
}