From 5371104a2d10889c532bb5d345fa6d71c0a897d1 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 29 Oct 2008 10:01:28 +0000 Subject: - Patch #316225 by sun et al: allow behaviors to detach from AHAH/AJAX. --- modules/comment/comment.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'modules/comment') diff --git a/modules/comment/comment.js b/modules/comment/comment.js index d639a4abd..b951f4211 100644 --- a/modules/comment/comment.js +++ b/modules/comment/comment.js @@ -1,14 +1,16 @@ // $Id$ -Drupal.behaviors.comment = function(context) { - var parts = new Array("name", "homepage", "mail"); - var cookie = ''; - for (i=0;i<3;i++) { - cookie = Drupal.comment.getCookie('comment_info_' + parts[i]); - if (cookie != '') { - $("#comment-form input[name=" + parts[i] + "]:not(.comment-processed)", context) - .val(cookie) - .addClass('comment-processed'); +Drupal.behaviors.comment = { + attach: function(context) { + var parts = new Array("name", "homepage", "mail"); + var cookie = ''; + for (i=0;i<3;i++) { + cookie = Drupal.comment.getCookie('comment_info_' + parts[i]); + if (cookie != '') { + $("#comment-form input[name=" + parts[i] + "]:not(.comment-processed)", context) + .val(cookie) + .addClass('comment-processed'); + } } } }; -- cgit v1.2.3