diff --git a/core/modules/user/user.css b/core/modules/user/user.css index 2c88121..3492df9 100644 --- a/core/modules/user/user.css +++ b/core/modules/user/user.css @@ -19,6 +19,7 @@ .password-strength { width: 17em; float: right; /* LTR */ + margin-top: 1.4em; } .password-strength-title { display: inline; @@ -44,6 +45,7 @@ input.password-field { } div.password-confirm { float: right; /* LTR */ + margin-top: 1.5em; visibility: hidden; width: 17em; } diff --git a/core/modules/user/user.js b/core/modules/user/user.js index e35eeef..d328f56 100644 --- a/core/modules/user/user.js +++ b/core/modules/user/user.js @@ -13,24 +13,24 @@ Drupal.behaviors.password = { var passwordInput = $(this); var innerWrapper = $(this).parent(); var outerWrapper = $(this).parent().parent(); + var confirmInput = outerWrapper.find('input.password-confirm'); // Add identifying class to password element parent. innerWrapper.addClass('password-parent'); - // Add the password confirmation layer. - outerWrapper.find('input.password-confirm').parent().append('
' + translate.confirmTitle + '
').addClass('confirm-parent'); - var confirmInput = outerWrapper.find('input.password-confirm'); - var confirmResult = outerWrapper.find('div.password-confirm'); - var confirmChild = confirmResult.find('span'); - // If the password strength indicator is enabled, add its markup. if (settings.password.showStrengthIndicator) { - var passwordMeter = '
' + translate.strengthTitle + '
'; + var passwordMeter = '
' + translate.strengthTitle + '
'; confirmInput.parent().after('
'); innerWrapper.append(passwordMeter); var passwordDescription = outerWrapper.find('div.password-suggestions').hide(); } + // Add the password confirmation layer. + var passwordConfirm = '
' + translate.confirmTitle + '
'; + outerWrapper.find('input.password-confirm').parent().prepend(passwordConfirm).addClass('confirm-parent'); + var confirmResult = outerWrapper.find('div.password-confirm'); + // Check that password and confirmation inputs match. var passwordCheckMatch = function (confirmInputVal) { var success = passwordInput.val() === confirmInputVal;