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: http://svn.automattic.com/wordpress/trunk@9708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9050fd4a5a
commit
e00cb4d429
|
@ -200,11 +200,17 @@ jQuery(document).ready( function($) {
|
||||||
return true;
|
return true;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
$( 'thead :checkbox, tfoot :checkbox' ).click( function() {
|
$( 'thead :checkbox, tfoot :checkbox' ).click( function(e) {
|
||||||
$(this).parents( 'form:first' ).find( 'tbody:visible .check-column :checkbox' ).attr( 'checked', function() {
|
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';
|
return $(this).attr( 'checked' ) ? '' : 'checked';
|
||||||
|
else if (c)
|
||||||
|
return 'checked';
|
||||||
|
|
||||||
|
return '';
|
||||||
});
|
});
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue