From e6e29ac1b0d6780241ced3d5ebcb0558e219e468 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 31 Aug 2009 05:51:08 +0000 Subject: =?UTF-8?q?-=20Patch=20#444344=20by=20kkaefer,=20sun,=20Rob=20Loac?= =?UTF-8?q?h:=20this=20change=20introduces=20a=20jQuery=20.once()=20method?= =?UTF-8?q?=20which=20streamlines=20the=20way=20behavior=20functions=20wor?= =?UTF-8?q?k.=20Previously,=20we=20had=20to=20manually=20ensure=20that=20a?= =?UTF-8?q?n=20element=20is=20only=20initialized=20once.=20Usually,=20this?= =?UTF-8?q?=20happens=20by=20adding=20classes=20and=20selecting=20only=20t?= =?UTF-8?q?hose=20elements=20which=20do=20not=20have=20that=20class.=20How?= =?UTF-8?q?ever,=20this=20process=20can=20be=20separated=20out=20into=20a?= =?UTF-8?q?=20jQuery=20=E2=80=98filtering=E2=80=99=20function=20which=20do?= =?UTF-8?q?es=20all=20the=20grunt=20work.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/user/user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/user') 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(); -- cgit v1.2.3