summaryrefslogtreecommitdiff
path: root/templates/project/widgets/meter/meter.coffee
blob: b823ec7a4fa84f28b2638101a0562bf5f23ef546 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Dashing.Meter extends Dashing.Widget

  @accessor 'value', Dashing.AnimatedValue

  constructor: ->
    super
    @observe 'value', (value) ->
      $(@node).find(".meter").val(value).trigger('change')

  ready: ->
    meter = $(@node).find(".meter")
    meter.attr("data-bgcolor", meter.css("background-color"))
    meter.attr("data-fgcolor", meter.css("color"))
    meter.knob()