Sha256: 1266583f3cb79c541353456157f1d144a4a0b31600bc75435ee328f53a2357be
Contents?: true
Size: 746 Bytes
Versions: 23
Compression:
Stored size: 746 Bytes
Contents
class MyDashboard.Number extends MyDashboard.Widget @accessor 'current', MyDashboard.AnimatedValue @accessor 'difference', -> if @get('last') last = parseInt(@get('last')) current = parseInt(@get('current')) if last != 0 diff = Math.abs(Math.round((current - last) / last * 100)) "#{diff}%" else "" @accessor 'arrow', -> if @get('last') if parseInt(@get('current')) > parseInt(@get('last')) then 'fa fa-arrow-up' else 'fa fa-arrow-down' onData: (data) -> if data.status # clear existing "status-*" classes $(@get('node')).attr 'class', (i,c) -> c.replace /\bstatus-\S+/g, '' # add new class $(@get('node')).addClass "status-#{data.status}"
Version data entries
23 entries across 23 versions & 1 rubygems