diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-02-19 14:33:24 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-02-19 14:33:24 +0100 |
commit | 952584e9c782d196eb2bcd6df1e3ecdf21adcb55 (patch) | |
tree | 7900602434f86a503b800f63ceb0a6a7b4499964 /apps/files/js/files.js | |
parent | f9d4780d27ca21d86d8dacf73eda52a73a479d61 (diff) | |
parent | 94b3296a71c5950f70919836bc12f0066016b705 (diff) | |
download | nextcloud-server-952584e9c782d196eb2bcd6df1e3ecdf21adcb55.tar.gz nextcloud-server-952584e9c782d196eb2bcd6df1e3ecdf21adcb55.zip |
Merge pull request #7195 from owncloud/files-selectall
Do not send file list for select all on Download/delete
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r-- | apps/files/js/files.js | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 1ec4c4ec7ab..fbac601f67a 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; }); |