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

git-svn-id: https://develop.svn.wordpress.org/trunk@33475 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2015-07-29 04:29:36 +00:00
parent fff891b1d9
commit 11f4909315

View File

@ -178,7 +178,9 @@
$generateButton.hide();
$passwordWrapper.show();
generatePassword();
if ( $pass1Text.val().length === 0 ) {
generatePassword();
}
_.defer( function() {
$pass1Text.focus();
@ -205,7 +207,7 @@
}
function check_pass_strength() {
var pass1 = $('#pass1').val(), pass2 = $('#pass2').val(), strength;
var pass1 = $('#pass1').val(), strength;
$('#pass-strength-result').removeClass('short bad good strong');
if ( ! pass1 ) {
@ -213,7 +215,7 @@
return;
}
strength = wp.passwordStrength.meter( pass1, wp.passwordStrength.userInputBlacklist(), pass2 );
strength = wp.passwordStrength.meter( pass1, wp.passwordStrength.userInputBlacklist(), pass1 );
switch ( strength ) {
case 2: