Make WordPress Core

Ticket #33385: 33385.4.diff

File 33385.4.diff, 1.7 KB (added by adamsilverstein, 9 years ago)
  • src/wp-admin/js/user-profile.js

     
    4747                        .addClass( $pass1[0].className )
    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;
    5353                                }
     
    6262                        generatePassword();
    6363                }
    6464
    65                 $pass1.on( 'input propertychange pwupdate', function () {
     65                $pass1.on( 'keyup pwupdate', function () {
    6666                        if ( $pass1.val() === currentPass ) {
    6767                                return;
    6868                        }
    6969
    7070                        currentPass = $pass1.val();
    71                         $pass1Text.val( currentPass );
     71                        if ( $pass1Text.val() !== currentPass ) {
     72                                $pass1Text.val( currentPass );
     73                        }
     74
    7275                        $pass1.add( $pass1Text ).removeClass( 'short bad good strong' );
    7376
    7477                        if ( passStrength.className ) {
     
    163166                 * This fixes the issue by copying any changes from the hidden
    164167                 * pass2 field to the pass1 field, then running check_pass_strength.
    165168                 */
    166                 $pass2 = $('#pass2').on( 'input propertychange', function () {
     169                $pass2 = $('#pass2');
     170                $pass2.on( 'keyup', function () {
    167171                        if ( $pass2.val().length > 0 ) {
    168172                                $pass1.val( $pass2.val() );
    169173                                $pass2.val('');
     
    244248                var $colorpicker, $stylesheet, user_id, current_user_id,
    245249                        select = $( '#display_name' );
    246250
    247                 $('#pass1').val('').on( 'input propertychange pwupdate', check_pass_strength );
     251                $('#pass1').val('').on( 'keyup pwupdate', check_pass_strength );
    248252                $('#pass-strength-result').show();
    249253                $('.color-palette').click( function() {
    250254                        $(this).siblings('input[name="admin_color"]').prop('checked', true);