From d9b58bd4ac48d6029aeaf0b7f9dce4ed3d3e3763 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 19 Sep 2015 16:40:34 +0000 Subject: [PATCH] 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 --- src/wp-admin/js/common.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/js/common.js b/src/wp-admin/js/common.js index 5b5741c154..35ce89f3e5 100644 --- a/src/wp-admin/js/common.js +++ b/src/wp-admin/js/common.js @@ -409,7 +409,7 @@ $(document).ready( function() { if ( 'undefined' == e.shiftKey ) { return true; } if ( e.shiftKey ) { if ( !lastClicked ) { return true; } - checks = $( lastClicked ).closest( 'form' ).find( ':checkbox' ); + checks = $( lastClicked ).closest( 'form' ).find( ':checkbox' ).filter( ':visible:enabled' ); first = checks.index( lastClicked ); last = checks.index( this ); checked = $(this).prop('checked'); @@ -426,7 +426,7 @@ $(document).ready( function() { lastClicked = this; // 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() { return ( 0 === unchecked.length ); }); @@ -443,7 +443,7 @@ $(document).ready( function() { $table.children( 'tbody' ).filter(':visible') .children().children('.check-column').find(':checkbox') .prop('checked', function() { - if ( $(this).is(':hidden') ) { + if ( $(this).is(':hidden,:disabled') ) { return false; }