]> source.dussan.org Git - nextcloud-server.git/commitdiff
implemented download single file from file menu
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Mon, 18 Apr 2011 14:59:30 +0000 (16:59 +0200)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Mon, 18 Apr 2011 14:59:30 +0000 (16:59 +0200)
files/js/files.js
files/templates/index.php

index 06d5dbf032852b1108cbccf1b333c41df89f9bcc..f1cb200817b2432de4108b129aae20f7e492ed5a 100644 (file)
@@ -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,
index d38e771c2e1e8f7ae46a1861bfd5bb78f3ad5bb4..f761f1f538d4a9930c9a1f5753f23ae0f343008d 100644 (file)
@@ -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>