Admin: when toggling select/deselect "all" via JS - `:visible` needs to be bound to not toggle disabled inputs.

Props tywayne.
Fixes #32309.

Built from https://develop.svn.wordpress.org/trunk@34325


git-svn-id: http://core.svn.wordpress.org/trunk@34289 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-09-19 16:41:24 +00:00
parent e47963d1e7
commit 28964445d4
3 changed files with 5 additions and 5 deletions

View File

@ -409,7 +409,7 @@ $(document).ready( function() {
if ( 'undefined' == e.shiftKey ) { return true; } if ( 'undefined' == e.shiftKey ) { return true; }
if ( e.shiftKey ) { if ( e.shiftKey ) {
if ( !lastClicked ) { return true; } if ( !lastClicked ) { return true; }
checks = $( lastClicked ).closest( 'form' ).find( ':checkbox' ); checks = $( lastClicked ).closest( 'form' ).find( ':checkbox' ).filter( ':visible:enabled' );
first = checks.index( lastClicked ); first = checks.index( lastClicked );
last = checks.index( this ); last = checks.index( this );
checked = $(this).prop('checked'); checked = $(this).prop('checked');
@ -426,7 +426,7 @@ $(document).ready( function() {
lastClicked = this; lastClicked = this;
// toggle "check all" checkboxes // toggle "check all" checkboxes
var unchecked = $(this).closest('tbody').find(':checkbox').filter(':visible').not(':checked'); var unchecked = $(this).closest('tbody').find(':checkbox').filter(':visible:enabled').not(':checked');
$(this).closest('table').children('thead, tfoot').find(':checkbox').prop('checked', function() { $(this).closest('table').children('thead, tfoot').find(':checkbox').prop('checked', function() {
return ( 0 === unchecked.length ); return ( 0 === unchecked.length );
}); });
@ -443,7 +443,7 @@ $(document).ready( function() {
$table.children( 'tbody' ).filter(':visible') $table.children( 'tbody' ).filter(':visible')
.children().children('.check-column').find(':checkbox') .children().children('.check-column').find(':checkbox')
.prop('checked', function() { .prop('checked', function() {
if ( $(this).is(':hidden') ) { if ( $(this).is(':hidden,:disabled') ) {
return false; return false;
} }

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.4-alpha-34324'; $wp_version = '4.4-alpha-34325';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.