summaryrefslogtreecommitdiff
path: root/templates/project/widgets/meter/meter.coffee
blob: 0e0a8ad35ab401e2dc18e46907616c6e50cc6446 (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()