toggle select all checkbox

This commit is contained in:
Bjoern Schiessle 2013-12-12 16:45:45 +01:00
parent 5ba9344b0e
commit 79719d9ae5
1 changed files with 8 additions and 0 deletions

View 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();
});