diff --git a/core/modules/user/user.css b/core/modules/user/user.css index 866ee40..b5296ad 100644 --- a/core/modules/user/user.css +++ b/core/modules/user/user.css @@ -20,7 +20,6 @@ .password-strength { width: 17em; float: right; /* LTR */ - margin-top: 1.4em; } .password-strength-title { display: inline; @@ -46,7 +45,6 @@ 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 8e0e135..c8647ce 100644 --- a/core/modules/user/user.js +++ b/core/modules/user/user.js @@ -13,20 +13,15 @@ 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().prepend('
' + translate.confirmTitle + '
').addClass('confirm-parent'); - var confirmInput = outerWrapper.find('input.password-confirm'); - var confirmResult = outerWrapper.find('div.password-confirm'); - var confirmChild = confirmResult.find('span'); - // Add the description box. - var passwordMeter = '
' + translate.strengthTitle + '
'; + var passwordMeter = '
' + translate.strengthTitle + '
'; confirmInput.parent().after('
'); - innerWrapper.prepend(passwordMeter); + innerWrapper.append(passwordMeter); var passwordDescription = outerWrapper.find('div.password-suggestions').hide(); // Check the password strength. @@ -59,6 +54,12 @@ Drupal.behaviors.password = { passwordCheckMatch(); }; + // 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'); + var confirmChild = confirmResult.find('span'); + // Check that password and confirmation inputs match. var passwordCheckMatch = function () {