Don't select hidden rows' checkboxes when selecting all, fixes #8520

git-svn-id: https://develop.svn.wordpress.org/trunk@10107 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2008-12-07 09:04:38 +00:00
parent 6a21085e62
commit adb001a76c
2 changed files with 10 additions and 2 deletions

View File

@ -192,8 +192,14 @@ jQuery(document).ready( function($) {
var checks = $( lastClicked ).parents( 'form:first' ).find( ':checkbox' );
var first = checks.index( lastClicked );
var last = checks.index( this );
var checked = $(this).attr('checked');
if ( 0 < first && 0 < last && first != last ) {
checks.slice( first, last ).attr( 'checked', $( this ).is( ':checked' ) ? 'checked' : '' );
checks.slice( first, last ).attr( 'checked', function(){
if ( $(this).parents('tr').is(':visible') )
return checked ? 'checked' : '';
return '';
});
}
}
lastClicked = this;
@ -205,6 +211,8 @@ jQuery(document).ready( function($) {
toggleWithKeyboard = false;
var toggle = e.shiftKey || toggleWithKeyboard;
$(this).parents( 'form:first' ).find( 'table tbody:visible').find( '.check-column :checkbox' ).attr( 'checked', function() {
if ( $(this).parents('tr').is(':hidden') )
return '';
if ( toggle )
return $(this).attr( 'checked' ) ? '' : 'checked';
else if (c)

View File

@ -41,7 +41,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->base_url = $guessurl;
$scripts->default_version = get_bloginfo( 'version' );
$scripts->add( 'common', '/wp-admin/js/common.js', array('jquery', 'hoverIntent'), '20081206' );
$scripts->add( 'common', '/wp-admin/js/common.js', array('jquery', 'hoverIntent'), '20081206b' );
$scripts->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' );
$scripts->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '20081103' );