app/assets/javascripts/backbone/views/tabbar/tab.js.coffee
6a6ccd01
 Xmpp.Views.Tabbar ||= {}
 
 class Xmpp.Views.Tabbar.TabView extends Backbone.View
   template: JST["backbone/templates/tabbar/tab"]
   tagName: 'div'
   className: 'tab'
 
   events:
     'click .js-close': 'closeChat'
 
   initialize: () ->
     _.bindAll(this)
 
   setActive: ->
     $(@el).addClass('active')
     @render()
 
   setInactive: ->
     $(@el).removeClass('active')
     @render()
 
   render: ->
     $(@el).html(@template(
       who:      @model.get('who').firstname(),
       withWhom: @model.get('withWhom').firstname()
     ))
     return this
 
   closeChat: ->
bcce524b
     Backbone.Events.trigger('closeChat', this, @model)
6a6ccd01
     @remove()
 
   hasParticipants: (who, withWhom) ->
     @model && @model.get('who') == who && @model.get('withWhom') == withWhom