Skip to content

Commit

Permalink
Remove tab on channel part.
Browse files Browse the repository at this point in the history
  • Loading branch information
akavlie committed Jan 14, 2012
1 parent ef79c82 commit 6bb3dfd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions assets/js/views/channel_tab.js
Expand Up @@ -7,6 +7,7 @@ var ChannelTabView = Backbone.View.extend({

initialize: function() {
this.model.stream.bind('add', this.updateUnreadCounts, this);
this.model.bind('destroy', this.close, this);
},

render: function() {
Expand Down Expand Up @@ -42,4 +43,17 @@ var ChannelTabView = Backbone.View.extend({
this.model.set({unread: 0, unreadMentions: 0});
},

close: function() {
// Focus on next frame if this one has the focus
if ($(this.el).hasClass('active')) {
// Go to previous frame unless it's status
if ($(this.el).prev().text().trim() !== 'status') {
$(this.el).prev().click();
} else {
$(this.el).next().click();
}
}
this.remove();
}

});

0 comments on commit 6bb3dfd

Please sign in to comment.