diff options
author | nickago <ngonella@calpoly.edu> | 2015-06-28 16:36:19 -0700 |
---|---|---|
committer | nickago <ngonella@calpoly.edu> | 2015-06-29 15:25:51 -0700 |
commit | 9afbc9c206d12b2d38cf853f37f4ba678bbd1d90 (patch) | |
tree | 637f852431e54efc4ae82d9a7238877a86c26268 | |
parent | e6b5bdef82b23d61286ff455ee245a26a40d195f (diff) | |
download | chat-9afbc9c206d12b2d38cf853f37f4ba678bbd1d90.tar.gz chat-9afbc9c206d12b2d38cf853f37f4ba678bbd1d90.tar.bz2 chat-9afbc9c206d12b2d38cf853f37f4ba678bbd1d90.zip |
Sorted the channel members popover lexigraphically
-rw-r--r-- | web/react/components/channel_header.jsx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/web/react/components/channel_header.jsx b/web/react/components/channel_header.jsx index 428d3ed81..f4e4078a5 100644 --- a/web/react/components/channel_header.jsx +++ b/web/react/components/channel_header.jsx @@ -44,8 +44,13 @@ var ExtraMembers = React.createClass({ var count = this.props.members.length == 0 ? "-" : this.props.members.length; count = this.props.members.length > 19 ? "20+" : count; var data_content = ""; + var sortedMembers = this.state.extra_info.members - this.props.members.forEach(function(m) { + sortedMembers.sort(function(a,b) { + return a.username.localeCompare(b.username) + }) + + sortedMembers.forEach(function(m) { data_content += "<div style='white-space: nowrap'>" + m.username + "</div>"; }); |