Passwords: Trigger a wp-check-valid-field
event when the password field is filled with a password by generatePassword()
.
Updates event handler in `wpAjax.invalidateForm()` to support `wp-check-valid-field`. See #33406. git-svn-id: https://develop.svn.wordpress.org/trunk@34114 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c16e8b5616
commit
0a77429937
@ -32,7 +32,7 @@
|
||||
setTimeout( generatePassword, 50 );
|
||||
} else {
|
||||
$pass1.val( $pass1.data( 'pw' ) );
|
||||
$pass1.trigger( 'pwupdate' );
|
||||
$pass1.trigger( 'pwupdate' ).trigger( 'wp-check-valid-field' );
|
||||
if ( 1 !== parseInt( $toggleButton.data( 'start-masked' ), 10 ) ) {
|
||||
$pass1Wrap.addClass( 'show-password' );
|
||||
} else {
|
||||
|
@ -50,7 +50,7 @@ var wpAjax = jQuery.extend( {
|
||||
return true;
|
||||
},
|
||||
invalidateForm: function ( selector ) {
|
||||
return jQuery( selector ).addClass( 'form-invalid' ).find('input').one( 'change', function() { jQuery(this).closest('.form-invalid').removeClass( 'form-invalid' ); } );
|
||||
return jQuery( selector ).addClass( 'form-invalid' ).find('input').one( 'change wp-check-valid-field', function() { jQuery(this).closest('.form-invalid').removeClass( 'form-invalid' ); } );
|
||||
},
|
||||
validateForm: function( selector ) {
|
||||
selector = jQuery( selector );
|
||||
|
Loading…
Reference in New Issue
Block a user