]> source.dussan.org Git - nextcloud-server.git/commitdiff
toggle select all checkbox
authorBjoern Schiessle <schiessle@owncloud.com>
Thu, 12 Dec 2013 15:45:45 +0000 (16:45 +0100)
committerBjoern Schiessle <schiessle@owncloud.com>
Thu, 12 Dec 2013 16:33:04 +0000 (17:33 +0100)
apps/files_trashbin/js/trash.js

index 48e9629f7def0b3dc6636c6a1502d6821795e388..1ff5bac6130762c82404997b02b5430755cd43e5 100644 (file)
@@ -152,6 +152,14 @@ $(document).ready(function() {
        $('#fileList').on('click', 'td.filename input', function() {
                var checkbox = $(this).parent().children('input:checkbox');
                $(checkbox).parent().parent().toggleClass('selected');
+               if ($(checkbox).is(':checked')) {
+                       var selectedCount = $('td.filename input:checkbox:checked').length;
+                       if (selectedCount === $('td.filename input:checkbox').length) {
+                               $('#select_all').prop('checked', true);
+                       }
+               } else {
+                       $('#select_all').prop('checked',false);
+               }
                procesSelection();
        });