Skip to content

Commit

Permalink
Add message type to message el.className, so error messages (and soon…
Browse files Browse the repository at this point in the history
… events) get special styling.
  • Loading branch information
akavlie committed Nov 4, 2011
1 parent 37a6279 commit d1a213f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app.js
Expand Up @@ -82,6 +82,7 @@ $(function() {
var MessageView = Backbone.View.extend({
tmpl: $('#message-tmpl').html(),
initialize: function() {
this.el.className = this.model.get('type');
this.render();
},

Expand Down Expand Up @@ -115,8 +116,7 @@ $(function() {
var position = this.$('#output').scrollTop();
}
var view = new MessageView({model: message});
var el = view.make('div', {className: message.get('type')});
$('#output').append(el);
$('#output').append(view.el);
// Scroll to bottom on new message if already at bottom
if (atBottom) {
$('#output').scrollTop(position + 100);
Expand Down Expand Up @@ -377,7 +377,7 @@ $(function() {
});

socket.on('names', function(data) {
frame = frames.getByName(data.channel);
var frame = frames.getByName(data.channel);
console.log(data);
for (var nick in data.nicks) {
frame.participants.add({nick: nick, opStatus: data.nicks[nick]});
Expand Down

0 comments on commit d1a213f

Please sign in to comment.