aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js/files.js
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-02-20 16:55:18 +0100
committerRobin Appelman <icewind@owncloud.com>2014-02-20 16:55:18 +0100
commit0624476aa19a63b1f4e35f35e151c3fc46cb697f (patch)
tree67e9ead3bfd44e7efe3f4a6d1325866075dbd702 /apps/files/js/files.js
parentf33d35cd073addb08c78a65b719c72eb5424434a (diff)
parentec45a3c0e2567c89729bc6fe8c996b7939025429 (diff)
downloadnextcloud-server-0624476aa19a63b1f4e35f35e151c3fc46cb697f.tar.gz
nextcloud-server-0624476aa19a63b1f4e35f35e151c3fc46cb697f.zip
Merge branch 'master' into mimeicons-svg
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r--apps/files/js/files.js23
1 files changed, 13 insertions, 10 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index dab060229e6..8b252e69a1d 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -364,23 +364,26 @@ $(document).ready(function() {
});
$('.download').click('click',function(event) {
- var files=getSelectedFilesTrash('name');
- var fileslist = JSON.stringify(files);
- var dir=$('#dir').val()||'/';
- OC.Notification.show(t('files','Your download is being prepared. This might take some time if the files are big.'));
- // 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);
- } else {
- window.location = OC.filePath('files', 'ajax', 'download.php') + '?'+ $.param({ dir: dir, files: fileslist });
+ var files;
+ var dir = FileList.getCurrentDirectory();
+ if (FileList.isAllSelected()) {
+ files = OC.basename(dir);
+ dir = OC.dirname(dir) || '/';
}
+ else {
+ files = getSelectedFilesTrash('name');
+ }
+ OC.Notification.show(t('files','Your download is being prepared. This might take some time if the files are big.'));
+ OC.redirect(FileList.getDownloadUrl(files, dir));
return false;
});
$('.delete-selected').click(function(event) {
var files=getSelectedFilesTrash('name');
event.preventDefault();
+ if (FileList.isAllSelected()) {
+ files = null;
+ }
FileList.do_delete(files);
return false;
});