Simplify subs member list rendering

(imported from commit 8772bc09341a89245c6013dcf106ce52c81abe7a)
This commit is contained in:
Scott Feeney 2013-09-06 01:40:37 -04:00
parent 1c2479c807
commit eb59d06aab
1 changed files with 2 additions and 8 deletions

View File

@ -217,17 +217,11 @@ function add_sub_to_table(sub) {
}
function format_member_list_elem(name, email) {
return name + ' <' + email + '>';
return name + (email ? ' <' + email + '>' : '');
}
function add_to_member_list(ul, name, email) {
var member;
if (email === undefined) {
member = name;
} else {
member = format_member_list_elem(name, email);
}
$('<li>').prependTo(ul).text(member);
$('<li>').prependTo(ul).text(format_member_list_elem(name, email));
}
function mark_subscribed(stream_name, attrs) {