diff options
Diffstat (limited to 'modules/comment/comment.js')
-rw-r--r-- | modules/comment/comment.js | 20 |
1 files changed, 11 insertions, 9 deletions
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'); + } } } }; |