diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2011-04-18 16:59:30 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2011-04-18 16:59:30 +0200 |
commit | 4ae158bbe03e33ed4cf9b42af44ef7b7876a6fe2 (patch) | |
tree | a1436d46909ed995b931cee5ebe638c867650db9 /files | |
parent | 5a11e739b4fe3562df139798eac3566fa4809d60 (diff) | |
download | nextcloud-server-4ae158bbe03e33ed4cf9b42af44ef7b7876a6fe2.tar.gz nextcloud-server-4ae158bbe03e33ed4cf9b42af44ef7b7876a6fe2.zip |
implemented download single file from file menu
Diffstat (limited to 'files')
-rw-r--r-- | files/js/files.js | 9 | ||||
-rw-r--r-- | files/templates/index.php | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/files/js/files.js b/files/js/files.js index 06d5dbf0328..f1cb200817b 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -49,6 +49,14 @@ $(document).ready(function() { } }); + // Download current file + $('#download_single_file').click(function() { + filename = $('#file_menu').parents('tr:first').find('.filename:first').children('a:first').text(); + window.location='ajax/download.php?files='+filename+'&dir='+$('#dir').val(); + $('#file_menu').slideToggle(250); + return false; + }); + // Delete current file $('#delete_single_file').click(function() { filename = $('#file_menu').parents('tr:first').find('.filename:first').children('a:first').text(); @@ -121,7 +129,6 @@ $(document).ready(function() { }); files=files.substr(1);//remove leading ; - //send the browser to the download location $.ajax({ url: 'ajax/delete.php', data: "dir="+$('#dir').val()+"&files="+files, diff --git a/files/templates/index.php b/files/templates/index.php index d38e771c2e1..f761f1f538d 100644 --- a/files/templates/index.php +++ b/files/templates/index.php @@ -38,7 +38,7 @@ name="file_upload_target" src=""></iframe></form> <div id="file_menu"> <ul> - <li><a href="" title="">Download</a></li> + <li><a href="" title="" id="download_single_file">Download</a></li> <li><a href="" title="">Share</a></li> <li><a href="" title="" id="delete_single_file">Delete</a></li> </ul> |