diff options
Diffstat (limited to 'modules/comment')
-rw-r--r-- | modules/comment/comment.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/modules/comment/comment.js b/modules/comment/comment.js index 38a026b72..3d2b92edd 100644 --- a/modules/comment/comment.js +++ b/modules/comment/comment.js @@ -3,16 +3,14 @@ Drupal.behaviors.comment = { attach: function(context, settings) { - 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) + $.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'); } - } + }); } }; |