diff options
Diffstat (limited to 'modules/comment/comment.js')
-rw-r--r-- | modules/comment/comment.js | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/modules/comment/comment.js b/modules/comment/comment.js index 96ecbaf5d..69baf7423 100644 --- a/modules/comment/comment.js +++ b/modules/comment/comment.js @@ -1,15 +1,16 @@ // $Id$ -if (Drupal.jsEnabled) { - $(document).ready(function() { - 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] + "]").val(cookie); - } + +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.comment = {}; |