Permalink
Browse files

Change topic properly on switching channel focus; a few other minor t…

…weaks & optimizations.
  • Loading branch information...
1 parent 34db1c5 commit 0012715087b8c149e2af7606154fcf09e3b63dbc @akavlie committed Nov 11, 2011
Showing with 8 additions and 8 deletions.
  1. +8 −8 app.js
View
16 app.js
@@ -17,7 +17,9 @@ $(function() {
},
initialize: function() {
- this.set({text: this.parse( irc.util.escapeHTML(this.get('raw')) )});
+ if (this.get('raw')) {
+ this.set({text: this.parse( irc.util.escapeHTML(this.get('raw')) )});
+ }
},
parse: function(text) {
@@ -174,12 +176,11 @@ $(function() {
},
addAll: function(participants) {
- var self = this;
var nicks = [];
participants.each(function(p) {
- var text = self.tmpl(p.get('opStatus'), p.get('nick'));
+ var text = this.tmpl(p.get('opStatus'), p.get('nick'));
nicks.push(text);
- });
+ }, this);
$(this.el).html(nicks.join('\n'));
},
@@ -231,16 +232,15 @@ $(function() {
frames.setActive(this.focused);
this.$('#output #messages').empty();
- var self = this;
frame.stream.each(function(message) {
- self.addMessage(message, false);
- });
+ this.addMessage(message, false);
+ }, this);
nickList.addAll(frame.participants);
if (frame.get('type') == 'channel') {
this.$('#sidebar').show();
- this.$('#topic').show();
+ frame.get('topic') && this.updateTopic(frame);
$('.wrapper').css('margin-right', 205);
$('#messages').css('top', $('#topic').outerHeight(true));
} else {

0 comments on commit 0012715

Please sign in to comment.