diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-08-31 05:51:08 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-08-31 05:51:08 +0000 |
commit | e6e29ac1b0d6780241ced3d5ebcb0558e219e468 (patch) | |
tree | a6bdbf6b69ab26e54295d8063e7d1c839cd42f3a /modules/user | |
parent | 41dca3c4e0ec3d355977735f74af2e49ea0eedd7 (diff) | |
download | brdo-e6e29ac1b0d6780241ced3d5ebcb0558e219e468.tar.gz brdo-e6e29ac1b0d6780241ced3d5ebcb0558e219e468.tar.bz2 |
- Patch #444344 by kkaefer, sun, Rob Loach: this change introduces a jQuery .once() method which streamlines the way behavior functions work. Previously, we had to manually ensure that an element is only initialized once. Usually, this happens by adding classes and selecting only those elements which do not have that class. However, this process can be separated out into a jQuery ‘filtering’ function which does all the grunt work.
Diffstat (limited to 'modules/user')
-rw-r--r-- | modules/user/user.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/user/user.js b/modules/user/user.js index 9d75911fa..d382375ab 100644 --- a/modules/user/user.js +++ b/modules/user/user.js @@ -8,8 +8,8 @@ Drupal.behaviors.password = { attach: function (context, settings) { var translate = settings.password; - $('input.password-field:not(.password-processed)', context).each(function () { - var passwordInput = $(this).addClass('password-processed'); + $('input.password-field', context).once('password', function () { + var passwordInput = $(this); var innerWrapper = $(this).parent(); var outerWrapper = $(this).parent().parent(); |