transition: color 0.3s;
color: #88C56A;
}
-#kiwi .membercount {
- font-size: 0.9em;
- margin-bottom: 10px;
- padding: 0 0 5%;
- text-align: center;
-}
-#kiwi .membercount span {
- display: none;
-}
-#kiwi .membercount span.active {
- display: block;
-}
#kiwi .messages { }
#kiwi .messages.active { }
background-color: #DADADA;
border-left: 1px dashed #8A8A8A;
}
+
+#kiwi .memberlists .meta {
+ font-size: 0.9em;
+ margin-bottom: 10px;
+ text-align: center;
+}
+
#kiwi .memberlists ul { list-style: none; margin-left:2px; }
#kiwi .memberlists ul.active { }
#kiwi .memberlists ul li { padding:0 2px; }
#kiwi .right_bar { background:#252525; }
+
+#kiwi .memberlists .meta {
+ border-bottom: 1px solid #8A8A8A;
+ font-size: 0.9em;
+ margin-bottom: 10px;
+ padding: 0 0 5%;
+ text-align: center;
+}
+
#kiwi .memberlists ul li { padding: 0.2em 1em; }
#kiwi .memberlists ul li a.nick { color:#6d6d6d; }
#kiwi .memberlists ul li:hover {
transition: color 0.3s;
color: #88C56A;
}
-#kiwi .membercount {
- border-bottom: 1px solid #8A8A8A;
- font-size: 0.9em;
- margin-bottom: 10px;
- padding: 0 0 5%;
- text-align: center;
-}
-#kiwi .membercount span {
- display: none;
-}
-#kiwi .membercount span.active {
- display: block;
-}
#kiwi .messages .msg > div { color:#6d6d6d; font-family: Inconsolata, Consolas, 'courier new', monospace; }
#kiwi .messages .msg { border: none; padding: 2px 5px; }
transition: color 0.3s;
color: #88C56A;
}
-#kiwi .membercount {
- border-bottom: 1px solid #8A8A8A;
- font-size: 0.9em;
- margin-bottom: 10px;
- padding: 0 0 5%;
- text-align: center;
-}
-#kiwi .membercount span {
- display: none;
-}
-#kiwi .membercount span.active {
- display: block;
-}
#kiwi .messages { color: #333333; }
#kiwi .messages.active { }
border-left: 1px solid #8A8A8A;
}
#kiwi.narrow .right_bar { display:none; }
+
+#kiwi .memberlists .meta {
+ border-bottom: 1px solid #8A8A8A;
+ font-size: 0.9em;
+ margin-bottom: 10px;
+ padding: 0 0 5%;
+ text-align: center;
+}
+
#kiwi .memberlists ul { list-style: none; }
#kiwi .memberlists ul.active { }
#kiwi .memberlists ul li { padding: 0.2em 1em; }
_kiwi.view.MemberList = Backbone.View.extend({
- tagName: "ul",
+ tagName: "div",
events: {
"click .nick": "nickClick",
"click .channel_info": "channelInfoClick"
initialize: function (options) {
this.model.bind('all', this.render, this);
- $(this.el).appendTo('#kiwi .memberlists');
+ this.$el.appendTo('#kiwi .memberlists');
+
+ // Holds meta data. User counts, etc
+ this.$meta = $('<div class="meta"></div>').appendTo(this.$el);
+
+ // The list for holding the nicks
+ this.$list = $('<ul></ul>').appendTo(this.$el);
},
render: function () {
- var $this = this.$el;
- $this.empty();
-
+ var that = this;
+
+ this.$list.empty();
this.model.forEach(function (member) {
member.view.$el.data('member', member);
- $this.append(member.view.$el);
+ that.$list.append(member.view.$el);
});
-
- // User count
- if(this.model.channel.cid === _kiwi.app.panels().active.cid) {
- var members_count = this.model.length + ' ' + translateText('client_applets_chanlist_users');
- $('#kiwi .membercount > span.' + this.model.channel.cid).text(members_count);
- $('#kiwi .membercount > span.' + this.model.channel.cid).addClass('active');
+ // User count
+ if(this.model.channel.isActive()) {
+ this.renderMeta();
}
return this;
},
+
+ renderMeta: function() {
+ var members_count = this.model.length + ' ' + translateText('client_applets_chanlist_users');
+ this.$meta.text(members_count);
+ },
+
nickClick: function (event) {
var $target = $(event.currentTarget).parent('li'),
member = $target.data('member'),
$('#kiwi .memberlists').children().removeClass('active');
$(this.el).addClass('active');
- // User count
- var members_count = this.model.length + ' ' + translateText('client_applets_chanlist_users');
- var members_count_code = '<span class="' + this.model.channel.cid + '">';
-
- $('#kiwi .membercount').children().removeClass('active');
- // If the span for this panel doesn't exist, create it
- if($('#kiwi .membercount > span.' + this.model.channel.cid).length == 0){
- $(members_count_code).appendTo('#kiwi .membercount');
- }
-
- $('#kiwi .membercount > span.' + this.model.channel.cid).text(members_count);
- $('#kiwi .membercount > span.' + this.model.channel.cid).addClass('active');
+ this.renderMeta();
}
});
\ No newline at end of file