From 8a89c56b7ba75f3aff257e30af98ea287760cc7c Mon Sep 17 00:00:00 2001 From: Luke Faraone Date: Mon, 17 Sep 2012 13:02:41 -0400 Subject: [PATCH] Iterate through an array without using 'in', remove extra spacing. This corrects some additional bugs introduced in 9128ddd and a5f06bd identified by Keegan. We previously used "for i in"-style looping, which is sub-optimal. Move to a different style. We also had a weird spacing thing I introduced in a previous commit, which has now been fixed. (imported from commit 7334d8ee703564bedeb0ea939b0d64ad2d5fceba) --- zephyr/static/js/zephyr.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zephyr/static/js/zephyr.js b/zephyr/static/js/zephyr.js index 3c6c554b7c..e07fd57c54 100644 --- a/zephyr/static/js/zephyr.js +++ b/zephyr/static/js/zephyr.js @@ -228,7 +228,7 @@ function respond_to_zephyr() { } else if (zephyr.type === 'huddle') { $('#zephyr-type-tabs a[href="#personal-message"]').tab('show'); recipient = ''; - for (i in zephyr.display_recipient) { + for (var i = 0; i < zephyr.display_recipient.length; i++) { recipient += zephyr.display_recipient[i].name + ', '; } prepare_huddle(recipient); @@ -237,7 +237,7 @@ function respond_to_zephyr() { // representations of a user (name, username, email, etc.), just // deal with usernames. recipient = zephyr.display_recipient; - if ( recipient === username) { // that is, we sent the original message + if (recipient === username) { // that is, we sent the original message recipient = zephyr.sender; } prepare_huddle(recipient);