From bda52632a5aa033d44151c224a39236b223c6b0e Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sun, 26 Apr 2009 19:18:46 +0000 Subject: #444402 by kkaefer and RobLoach: Enforce coding standards on all core JavaScript. --- modules/comment/comment.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'modules/comment/comment.js') 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'); } - } + }); } }; -- cgit v1.2.3