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

Props tywayne.
Fixes #32309.


git-svn-id: https://develop.svn.wordpress.org/trunk@34325 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-09-19 16:40:34 +00:00
parent 6d51562d72
commit d9b58bd4ac
1 changed files with 3 additions and 3 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;
} }