mirror of
git://develop.git.wordpress.org/
synced 2025-01-18 21:28:02 +01:00
Improve the check all: click to check all checkboxes, click again to uncheck all, Shift/click to toggle. Shift/clicking two consecutive boxes checks the range between them as before. Fixes #8217
git-svn-id: https://develop.svn.wordpress.org/trunk@9708 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3c71d6a1c1
commit
b5b456f173
@ -200,11 +200,17 @@ jQuery(document).ready( function($) {
|
||||
return true;
|
||||
} );
|
||||
|
||||
$( 'thead :checkbox, tfoot :checkbox' ).click( function() {
|
||||
$(this).parents( 'form:first' ).find( 'tbody:visible .check-column :checkbox' ).attr( 'checked', function() {
|
||||
return $(this).attr( 'checked' ) ? '' : 'checked';
|
||||
$( 'thead :checkbox, tfoot :checkbox' ).click( function(e) {
|
||||
var c = $(this).attr('checked');
|
||||
|
||||
$(this).parents( 'form:first' ).find( 'table .check-column :checkbox' ).attr( 'checked', function() {
|
||||
if ( e.shiftKey )
|
||||
return $(this).attr( 'checked' ) ? '' : 'checked';
|
||||
else if (c)
|
||||
return 'checked';
|
||||
|
||||
return '';
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user