Make WordPress Core


Ignore:
Timestamp:
02/23/2021 07:43:23 PM (3 years ago)
Author:
SergeyBiryukov
Message:

External Libraries: Further fix jQuery deprecations in WordPress core.

This includes many minor adjustments to a wide array of core files to replace shorthands with full declarations.

Follow-up to [50001], [50270], [50367].

Props Clorith, hellofromTonya, peterwilsoncc, adamsilverstein, aristath.
See #51812.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/wp/updates.js

    r50027 r50420  
    630630                    $card
    631631                        .removeClass( 'plugin-card-update-failed' )
    632                         .find( '.column-name a' ).focus();
     632                        .find( '.column-name a' ).trigger( 'focus' );
    633633
    634634                    $card.find( '.update-now' )
     
    802802                $card
    803803                    .removeClass( 'plugin-card-update-failed' )
    804                     .find( '.column-name a' ).focus();
     804                    .find( '.column-name a' ).trigger( 'focus' );
    805805            }, 200 );
    806806        } );
     
    12161216            // Focus on Customize button after updating.
    12171217            if ( isModalOpen ) {
    1218                 $( '.load-customize:visible' ).focus();
     1218                $( '.load-customize:visible' ).trigger( 'focus' );
    12191219                $( '.theme-info .theme-autoupdate' ).find( '.auto-update-time' ).empty();
    12201220            } else {
    1221                 $theme.find( '.load-customize' ).focus();
     1221                $theme.find( '.load-customize' ).trigger( 'focus' );
    12221222            }
    12231223        }
     
    12721272            $notice = $( '.theme-info .notice' ).add( $theme.find( '.notice' ) );
    12731273
    1274             $( 'body.modal-open' ).length ? $( '.load-customize:visible' ).focus() : $theme.find( '.load-customize' ).focus();
     1274            $( 'body.modal-open' ).length ? $( '.load-customize:visible' ).trigger( 'focus' ) : $theme.find( '.load-customize' ).trigger( 'focus');
    12751275        }
    12761276
     
    17691769            // #upgrade button must always be the last focus-able element in the dialog.
    17701770            if ( 'upgrade' === event.target.id && ! event.shiftKey ) {
    1771                 $( '#hostname' ).focus();
     1771                $( '#hostname' ).trigger( 'focus' );
    17721772
    17731773                event.preventDefault();
    17741774            } else if ( 'hostname' === event.target.id && event.shiftKey ) {
    1775                 $( '#upgrade' ).focus();
     1775                $( '#upgrade' ).trigger( 'focus' );
    17761776
    17771777                event.preventDefault();
     
    17901790        $( 'body' ).addClass( 'modal-open' );
    17911791        $modal.show();
    1792         $modal.find( 'input:enabled:first' ).focus();
     1792        $modal.find( 'input:enabled:first' ).trigger( 'focus' );
    17931793        $modal.on( 'keydown', wp.updates.keydown );
    17941794    };
Note: See TracChangeset for help on using the changeset viewer.