Make WordPress Core

Ticket #32886: no-timeout.3.diff

File no-timeout.3.diff, 1.6 KB (added by markjaquith, 9 years ago)
  • src/wp-admin/js/user-profile.js

    diff --git src/wp-admin/js/user-profile.js src/wp-admin/js/user-profile.js
    index e744814..de87bb9 100644
     
    2727
    2828        function bindPass1() {
    2929                var passStrength = $('#pass-strength-result')[0];
     30                var currentPass = $pass1.val();
    3031
    3132                $pass1Wrap = $pass1.parent();
    3233
     
    5051                }
    5152
    5253                $pass1.on( 'input propertychange', function () {
    53                         setTimeout( function () {
    54                                 $pass1Text.val( $pass1.val() );
    55                                 $pass1.add( $pass1Text ).removeClass( 'short bad good strong' );
    56 
    57                                 if ( passStrength.className ) {
    58                                         $pass1.add( $pass1Text ).addClass( passStrength.className );
    59                                         if ( 'short' === passStrength.className || 'bad' === passStrength.className ) {
    60                                                 if ( ! $weakCheckbox.prop( 'checked' ) ) {
    61                                                         $submitButtons.prop( 'disabled', true );
    62                                                 }
    63                                                 $weakRow.show();
    64                                         } else {
    65                                                 $submitButtons.prop( 'disabled', false );
    66                                                 $weakRow.hide();
     54                        if ( $pass1.val() === currentPass ) {
     55                                return;
     56                        }
     57
     58                        currentPass = $pass1.val();
     59                        $pass1Text.val( currentPass );
     60                        $pass1.add( $pass1Text ).removeClass( 'short bad good strong' );
     61
     62                        if ( passStrength.className ) {
     63                                $pass1.add( $pass1Text ).addClass( passStrength.className );
     64                                if ( 'short' === passStrength.className || 'bad' === passStrength.className ) {
     65                                        if ( ! $weakCheckbox.prop( 'checked' ) ) {
     66                                                $submitButtons.prop( 'disabled', true );
    6767                                        }
     68                                        $weakRow.show();
     69                                } else {
     70                                        $submitButtons.prop( 'disabled', false );
     71                                        $weakRow.hide();
    6872                                }
    69                         }, 1 );
     73                        }
    7074                } );
    7175        }
    7276