Make WordPress Core

Changeset 34325


Ignore:
Timestamp:
09/19/2015 04:40:34 PM (9 years ago)
Author:
wonderboymusic
Message:

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

Props tywayne.
Fixes #32309.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/common.js

    r33106 r34325  
    410410        if ( e.shiftKey ) {
    411411            if ( !lastClicked ) { return true; }
    412             checks = $( lastClicked ).closest( 'form' ).find( ':checkbox' );
     412            checks = $( lastClicked ).closest( 'form' ).find( ':checkbox' ).filter( ':visible:enabled' );
    413413            first = checks.index( lastClicked );
    414414            last = checks.index( this );
     
    427427
    428428        // toggle "check all" checkboxes
    429         var unchecked = $(this).closest('tbody').find(':checkbox').filter(':visible').not(':checked');
     429        var unchecked = $(this).closest('tbody').find(':checkbox').filter(':visible:enabled').not(':checked');
    430430        $(this).closest('table').children('thead, tfoot').find(':checkbox').prop('checked', function() {
    431431            return ( 0 === unchecked.length );
     
    444444            .children().children('.check-column').find(':checkbox')
    445445            .prop('checked', function() {
    446                 if ( $(this).is(':hidden') ) {
     446                if ( $(this).is(':hidden,:disabled') ) {
    447447                    return false;
    448448                }
Note: See TracChangeset for help on using the changeset viewer.