Lose the clunky setTimeout() code and just track the password value changes.

see #32886
Built from https://develop.svn.wordpress.org/trunk@33465


git-svn-id: http://core.svn.wordpress.org/trunk@33432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Mark Jaquith 2015-07-28 21:11:26 +00:00
parent a4e751abc7
commit 959f36699b
3 changed files with 20 additions and 16 deletions

View File

@ -27,6 +27,7 @@
function bindPass1() {
var passStrength = $('#pass-strength-result')[0];
var currentPass = $pass1.val();
$pass1Wrap = $pass1.parent();
@ -50,23 +51,26 @@
}
$pass1.on( 'input propertychange', function () {
setTimeout( function () {
$pass1Text.val( $pass1.val() );
$pass1.add( $pass1Text ).removeClass( 'short bad good strong' );
if ( $pass1.val() === currentPass ) {
return;
}
if ( passStrength.className ) {
$pass1.add( $pass1Text ).addClass( passStrength.className );
if ( 'short' === passStrength.className || 'bad' === passStrength.className ) {
if ( ! $weakCheckbox.prop( 'checked' ) ) {
$submitButtons.prop( 'disabled', true );
}
$weakRow.show();
} else {
$submitButtons.prop( 'disabled', false );
$weakRow.hide();
currentPass = $pass1.val();
$pass1Text.val( currentPass );
$pass1.add( $pass1Text ).removeClass( 'short bad good strong' );
if ( passStrength.className ) {
$pass1.add( $pass1Text ).addClass( passStrength.className );
if ( 'short' === passStrength.className || 'bad' === passStrength.className ) {
if ( ! $weakCheckbox.prop( 'checked' ) ) {
$submitButtons.prop( 'disabled', true );
}
$weakRow.show();
} else {
$submitButtons.prop( 'disabled', false );
$weakRow.hide();
}
}, 1 );
}
} );
}

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.3-beta4-33464';
$wp_version = '4.3-beta4-33465';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.