151:0178573216e3
Anton Shestakov <av6@dwimlabs.net>, Thu, 14 Apr 2016 02:05:24 +0800
index: remove offline contacts only when they change to being offline Since new contacts are currently added while they still have the default presence of 'unavailable', add event sees them as offline and throws them away immediately, before their presence could change to something else.

next change 232:0fe8137e0f76
previous change 119:206de4ff7a6c

coffee/progress.coffee

Permissions: -rw-r--r--

Other formats: Feeds:
class window.Tram.ProgressApp extends Backbone.View
initialize: ->
@listenTo(@model, 'change:progress', @updateProgress)
@render()
getStyle: (progress) =>
"width: #{ progress ? 0 }%;"
updateProgress: ->
switch @model.get('progress')
when 0
setTimeout =>
if @model.get('progress') is 0
@model.set('progress', 10)
, 600
when 100
setTimeout =>
if @model.get('progress') is 100
@model.unset('progress')
, 600
render: ->
@rivet = rivets.bind(@el, model: @model, view: this)
@
remove: ->
@rivet.unbind()
super