Make WordPress Core

Ticket #32886: no-timeout.2.diff

File no-timeout.2.diff, 1.5 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..94d7c8b 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                        $pass1Text.val( $pass1.val() );
     58                        $pass1.add( $pass1Text ).removeClass( 'short bad good strong' );
     59
     60                        if ( passStrength.className ) {
     61                                $pass1.add( $pass1Text ).addClass( passStrength.className );
     62                                if ( 'short' === passStrength.className || 'bad' === passStrength.className ) {
     63                                        if ( ! $weakCheckbox.prop( 'checked' ) ) {
     64                                                $submitButtons.prop( 'disabled', true );
    6765                                        }
     66                                        $weakRow.show();
     67                                } else {
     68                                        $submitButtons.prop( 'disabled', false );
     69                                        $weakRow.hide();
    6870                                }
    69                         }, 1 );
     71                        }
    7072                } );
    7173        }
    7274