Make WordPress Core

Changeset 33625


Ignore:
Timestamp:
08/17/2015 06:45:33 PM (11 years ago)
Author:
obenland
Message:

Passwords: Use keyup event to prevent IE8's misinterpretation of propertychange.

Props adamsilverstein, peterwilsoncc.
Fixes #33385.

File:
1 edited

Legend:

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

    r33495 r33625  
    4848                        .data( 'pw', $pass1.data( 'pw' ) )
    4949                        .val( $pass1.val() )
    50                         .on( 'input propertychange', function () {
     50                        .on( 'keyup', function () {
    5151                                if ( $pass1Text.val() === currentPass ) {
    5252                                        return;
    … …  
    6363                }
    6464
    65                 $pass1.on( 'input propertychange pwupdate', function () {
     65                $pass1.on( 'keyup pwupdate', function () {
    6666                        if ( $pass1.val() === currentPass ) {
    6767                                return;
    … …  
    6969
    7070                        currentPass = $pass1.val();
    71                         $pass1Text.val( currentPass );
     71                        if ( $pass1Text.val() !== currentPass ) {
     72                                $pass1Text.val( currentPass );
     73                        }
    7274                        $pass1.add( $pass1Text ).removeClass( 'short bad good strong' );
    7375
    … …  
    164166                 * pass2 field to the pass1 field, then running check_pass_strength.
    165167                 */
    166                 $pass2 = $('#pass2').on( 'input propertychange', function () {
     168                $pass2 = $('#pass2').on( 'keyup', function () {
    167169                        if ( $pass2.val().length > 0 ) {
    168170                                $pass1.val( $pass2.val() );
    … …  
    245247                        select = $( '#display_name' );
    246248
    247                 $('#pass1').val('').on( 'input propertychange pwupdate', check_pass_strength );
     249                $('#pass1').val('').on( 'keyup pwupdate', check_pass_strength );
    248250                $('#pass-strength-result').show();
    249251                $('.color-palette').click( function() {
Note: See TracChangeset for help on using the changeset viewer.