aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Kavlie <akavlie@gmail.com>2011-11-10 23:06:03 -0700
committerAaron Kavlie <akavlie@gmail.com>2011-11-10 23:06:03 -0700
commit0012715087b8c149e2af7606154fcf09e3b63dbc (patch)
tree0e8d7cc14dd4a4d360e06bbb6cf31f20dac704e2
parent34db1c53b45323c061544a7e0b990940574c36f5 (diff)
downloadreevo-webirc-0012715087b8c149e2af7606154fcf09e3b63dbc.tar.gz
reevo-webirc-0012715087b8c149e2af7606154fcf09e3b63dbc.zip
Change topic properly on switching channel focus; a few other minor tweaks & optimizations.
-rw-r--r--app.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/app.js b/app.js
index a9f8311..d8cbb93 100644
--- a/app.js
+++ b/app.js
@@ -17,7 +17,9 @@ $(function() {
17 }, 17 },
18 18
19 initialize: function() { 19 initialize: function() {
20 this.set({text: this.parse( irc.util.escapeHTML(this.get('raw')) )}); 20 if (this.get('raw')) {
21 this.set({text: this.parse( irc.util.escapeHTML(this.get('raw')) )});
22 }
21 }, 23 },
22 24
23 parse: function(text) { 25 parse: function(text) {
@@ -174,12 +176,11 @@ $(function() {
174 }, 176 },
175 177
176 addAll: function(participants) { 178 addAll: function(participants) {
177 var self = this;
178 var nicks = []; 179 var nicks = [];
179 participants.each(function(p) { 180 participants.each(function(p) {
180 var text = self.tmpl(p.get('opStatus'), p.get('nick')); 181 var text = this.tmpl(p.get('opStatus'), p.get('nick'));
181 nicks.push(text); 182 nicks.push(text);
182 }); 183 }, this);
183 $(this.el).html(nicks.join('\n')); 184 $(this.el).html(nicks.join('\n'));
184 }, 185 },
185 186
@@ -231,16 +232,15 @@ $(function() {
231 frames.setActive(this.focused); 232 frames.setActive(this.focused);
232 this.$('#output #messages').empty(); 233 this.$('#output #messages').empty();
233 234
234 var self = this;
235 frame.stream.each(function(message) { 235 frame.stream.each(function(message) {
236 self.addMessage(message, false); 236 this.addMessage(message, false);
237 }); 237 }, this);
238 238
239 nickList.addAll(frame.participants); 239 nickList.addAll(frame.participants);
240 240
241 if (frame.get('type') == 'channel') { 241 if (frame.get('type') == 'channel') {
242 this.$('#sidebar').show(); 242 this.$('#sidebar').show();
243 this.$('#topic').show(); 243 frame.get('topic') && this.updateTopic(frame);
244 $('.wrapper').css('margin-right', 205); 244 $('.wrapper').css('margin-right', 205);
245 $('#messages').css('top', $('#topic').outerHeight(true)); 245 $('#messages').css('top', $('#topic').outerHeight(true));
246 } else { 246 } else {