Make WordPress Core

Changeset 33475


Ignore:
Timestamp:
07/29/2015 04:29:36 AM (9 years ago)
Author:
markjaquith
Message:

Do not re-generate the password after pressing "cancel". Persist the state.

Also removes pass2 code not needed since we're generating from one field.

fixes #33164

File:
1 edited

Legend:

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

    r33473 r33475  
    179179            $passwordWrapper.show();
    180180
    181             generatePassword();
     181            if ( $pass1Text.val().length === 0 ) {
     182                generatePassword();
     183            }
    182184
    183185            _.defer( function() {
     
    206208
    207209    function check_pass_strength() {
    208         var pass1 = $('#pass1').val(), pass2 = $('#pass2').val(), strength;
     210        var pass1 = $('#pass1').val(), strength;
    209211
    210212        $('#pass-strength-result').removeClass('short bad good strong');
     
    214216        }
    215217
    216         strength = wp.passwordStrength.meter( pass1, wp.passwordStrength.userInputBlacklist(), pass2 );
     218        strength = wp.passwordStrength.meter( pass1, wp.passwordStrength.userInputBlacklist(), pass1 );
    217219
    218220        switch ( strength ) {
Note: See TracChangeset for help on using the changeset viewer.