Created
September 18, 2013 15:46
-
-
Save scr512/6611171 to your computer and use it in GitHub Desktop.
Modified meter.coffee to allow for custom background color via JSON PUT.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | |
onData: (data) -> | |
if data['background-color'] | |
$(@get('node')).css 'background-color', data['background-color'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment