Fix: Show password toggle not working in checkout page
This commit is contained in:
parent
968f7ddc5b
commit
ab8ee194c8
|
@ -81,15 +81,17 @@ jQuery( function( $ ) {
|
||||||
|
|
||||||
// Show password visiblity hover icon on woocommerce forms
|
// Show password visiblity hover icon on woocommerce forms
|
||||||
$( '.woocommerce form .woocommerce-Input[type="password"]' ).wrap( '<span class="password-input"></span>' );
|
$( '.woocommerce form .woocommerce-Input[type="password"]' ).wrap( '<span class="password-input"></span>' );
|
||||||
|
// Add 'password-input' class to the password wrapper in checkout page.
|
||||||
|
$( '.woocommerce form input' ).filter(':password').parent('span').addClass('password-input');
|
||||||
$( '.password-input' ).append( '<span class="show-password-input"></span>' );
|
$( '.password-input' ).append( '<span class="show-password-input"></span>' );
|
||||||
|
|
||||||
$( '.show-password-input' ).click(
|
$( '.show-password-input' ).click(
|
||||||
function() {
|
function() {
|
||||||
$( this ).toggleClass( 'display-password' );
|
$( this ).toggleClass( 'display-password' );
|
||||||
if ( $( this ).hasClass( 'display-password' ) ) {
|
if ( $( this ).hasClass( 'display-password' ) ) {
|
||||||
$( this ).siblings( ['input[name^="password"]', 'input[type="password"]'] ).prop( 'type', 'text' );
|
$( this ).siblings( ['input[type="password"]'] ).prop( 'type', 'text' );
|
||||||
} else {
|
} else {
|
||||||
$( this ).siblings( 'input[name^="password"]' ).prop( 'type', 'password' );
|
$( this ).siblings( 'input[type="text"]' ).prop( 'type', 'password' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue