diff options
Diffstat (limited to 'modules/user/user.js')
-rw-r--r-- | modules/user/user.js | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/modules/user/user.js b/modules/user/user.js index cbd46c992..bdfa06b43 100644 --- a/modules/user/user.js +++ b/modules/user/user.js @@ -4,11 +4,10 @@ * Attach handlers to evaluate the strength of any password fields and to check * that its confirmation is correct. */ -Drupal.passwordAttach = function(context) { - var context = context || $(document); +Drupal.behaviors.password = function(context) { var translate = Drupal.settings.password; - $("input.password-field", context).each(function() { - var passwordInput = $(this); + $("input.password-field:not(.password-processed)", context).each(function() { + var passwordInput = $(this).addClass('password-processed'); var parent = $(this).parent(); // Wait this number of milliseconds before checking password. var monitorDelay = 700; @@ -173,11 +172,9 @@ Drupal.evaluatePasswordStrength = function(value) { * picture-related form elements depending on the current value of the * "Picture support" radio buttons. */ -if (Drupal.jsEnabled) { - $(document).ready(function () { - $('div.user-admin-picture-radios input[@type=radio]').click(function () { - $('div.user-admin-picture-settings')[['hide', 'show'][this.value]](); - }); - Drupal.passwordAttach(); +Drupal.behaviors.userSettings = function (context) { + $('div.user-admin-picture-radios input[@type=radio]:not(.userSettings-processed)', context).addClass('userSettings-processed').click(function () { + $('div.user-admin-picture-settings', context)[['hide', 'show'][this.value]](); }); -} +}; + |