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/comment/comment.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'modules/comment') diff --git a/modules/comment/comment.js b/modules/comment/comment.js index bdd1c3b95..58f00dc6b 100644 --- a/modules/comment/comment.js +++ b/modules/comment/comment.js @@ -6,9 +6,7 @@ Drupal.behaviors.comment = { $.each(['name', 'homepage', 'mail'], function () { var cookie = Drupal.comment.getCookie('comment_info_' + this); if (cookie) { - $('#comment-form input[name=' + this + ']:not(.comment-processed)', context) - .val(cookie) - .addClass('comment-processed'); + $('#comment-form input[name=' + this + ']', context).once('comment').val(cookie); } }); } -- cgit v1.2.3