]> source.dussan.org Git - nextcloud-server.git/commitdiff
make state of select all checkbox consistent
authorRobin Appelman <icewind1991@gmail.com>
Mon, 18 Apr 2011 10:49:52 +0000 (12:49 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Mon, 18 Apr 2011 11:16:49 +0000 (13:16 +0200)
files/js/files.js

index 6dc1f639e83a01cf69c30aece9592ded99656f45..906f33a9dd992a93c817324fc811f2fa9fd0306a 100644 (file)
@@ -39,6 +39,16 @@ $(document).ready(function() {
             $('td.selection input:checkbox').attr('checked', false);
     });
        
+       $('td.selection input:checkbox').click(function() {
+               if(!$(this).attr('checked')){
+                       $('#select_all').attr('checked',false);
+               }else{
+                       if($('td.selection input:checkbox:checked').length==$('td.selection input:checkbox').length){
+                               $('#select_all').attr('checked',true);
+                       }
+               }
+       });
+       
        // Delete current file 
        $('#delete_single_file').click(function() {
                filename = $('#file_menu').parents('tr:first').find('.filename:first').children('a:first').text();