322:7dfdf32e8577
Anton Shestakov <av6@dwimlabs.net>, Sat, 14 Jul 2018 20:23:13 +0800
index: authorizing contact also adds it to the roster Maybe there are cases when this doesn't make sense, but so far this looks like the right thing to do.

previous change 236:7e7d68a03bad

coffee/sidebar.coffee

Permissions: -rw-r--r--

Other formats: Feeds:
class window.Tram.SidebarApp extends Backbone.View
colors: Tram.colors.show
initialize: ->
@render()
getPipColor: (show) =>
"background: #{ @colors[show] || @colors['default'] };"
minify: =>
minified = not @model.get('sidebar/minified')
@model.set('sidebar/minified', minified)
@$el.parent().toggleClass('mini', minified)
show: (event) =>
$btn = $(event.currentTarget)
show = $btn.attr('data-show')
status = $btn.text().trim()
@model.trigger('action/show', show, status)
disconnect: =>
@model.trigger('action/disconnect')
render: ->
@rivet = rivets.bind(@el, model: @model, view: @)
@
remove: ->
@rivet.unbind()
super