Make WordPress Core

Changeset 34371


Ignore:
Timestamp:
09/22/2015 03:56:25 AM (9 years ago)
Author:
wonderboymusic
Message:

Passwords: fix the markup on the Reset Password Form for user-pass1 so the JavaScript operates properly.

Props ldinclaux.
See #33892.
Fixes #33908.

Location:
trunk/src
Files:
2 edited

Legend:

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

    r34312 r34371  
    191191        } );
    192192
    193         $passwordWrapper = $pass1Row.find('.wp-pwd').hide();
     193        $passwordWrapper = $pass1Row.find( '.wp-pwd' );
     194        $generateButton  = $pass1Row.find( 'button.wp-generate-pw' );
    194195
    195196        bindToggleButton();
    196197
    197         $generateButton = $pass1Row.find( 'button.wp-generate-pw' ).show();
     198        if ( $generateButton.length ) {
     199            $passwordWrapper.hide();
     200        }
     201
     202        $generateButton.show();
    198203        $generateButton.on( 'click', function () {
    199204            updateLock = true;
  • trunk/src/wp-login.php

    r34232 r34371  
    653653    <input type="hidden" id="user_login" value="<?php echo esc_attr( $rp_login ); ?>" autocomplete="off" />
    654654
    655     <p class="user-pass1-wrap">
    656         <label for="pass1"><?php _e( 'New password' ) ?></label>
    657     </p>
    658 
    659     <div class="wp-pwd">
    660         <span class="password-input-wrapper">
    661             <input type="password" data-reveal="1" data-pw="<?php echo esc_attr( wp_generate_password( 16 ) ); ?>" name="pass1" id="pass1" class="input" size="20" value="" autocomplete="off" aria-describedby="pass-strength-result" />
    662         </span>
    663         <div id="pass-strength-result" class="hide-if-no-js" aria-live="polite"><?php _e( 'Strength indicator' ); ?></div>
     655    <div class="user-pass1-wrap">
     656        <p>
     657            <label for="pass1"><?php _e( 'New password' ) ?></label>
     658        </p>
     659
     660        <div class="wp-pwd">
     661            <span class="password-input-wrapper">
     662                <input type="password" data-reveal="1" data-pw="<?php echo esc_attr( wp_generate_password( 16 ) ); ?>" name="pass1" id="pass1" class="input" size="20" value="" autocomplete="off" aria-describedby="pass-strength-result" />
     663            </span>
     664            <div id="pass-strength-result" class="hide-if-no-js" aria-live="polite"><?php _e( 'Strength indicator' ); ?></div>
     665        </div>
    664666    </div>
    665667
Note: See TracChangeset for help on using the changeset viewer.