Merge pull request #10587 from gonssal/password-strenght-meter-missing-wrapper-fix

Fixed password-strength-meter.js' checkPasswordStrength encapsulation
This commit is contained in:
Claudio Sanches 2016-03-21 15:01:54 -03:00
commit a259bd3841
1 changed files with 4 additions and 4 deletions

View File

@ -26,7 +26,7 @@ jQuery( function( $ ) {
wc_password_strength_meter.includeMeter( wrapper, field );
strength = wc_password_strength_meter.checkPasswordStrength( field );
strength = wc_password_strength_meter.checkPasswordStrength( wrapper, field );
if ( strength < wc_password_strength_meter_params.min_password_strength && ! wrapper.is( 'form.checkout' ) ) {
submit.attr( 'disabled', 'disabled' ).addClass( 'disabled' );
@ -60,9 +60,9 @@ jQuery( function( $ ) {
*
* @return {Int}
*/
checkPasswordStrength: function( field ) {
var meter = $( '.woocommerce-password-strength' );
var hint = $( '.woocommerce-password-hint' );
checkPasswordStrength: function( wrapper, field ) {
var meter = wrapper.find( '.woocommerce-password-strength' );
var hint = wrapper.find( '.woocommerce-password-hint' );
var hint_html = '<small class="woocommerce-password-hint">' + wc_password_strength_meter_params.i18n_password_hint + '</small>';
var strength = wp.passwordStrength.meter( field.val(), wp.passwordStrength.userInputBlacklist() );
var error = '';