From f800ba7ef7365fec368f51b15203ce25ee45303f Mon Sep 17 00:00:00 2001 From: Matthew Conway Date: Mon, 21 Oct 2013 15:56:00 -0700 Subject: [PATCH] Add support for updating the status of graph widgets --- templates/project/widgets/graph/graph.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/templates/project/widgets/graph/graph.coffee b/templates/project/widgets/graph/graph.coffee index 28ce88e1..25aa081f 100644 --- a/templates/project/widgets/graph/graph.coffee +++ b/templates/project/widgets/graph/graph.coffee @@ -34,3 +34,9 @@ class Dashing.Graph extends Dashing.Widget if @graph @graph.series[0].data = data.points @graph.render() + 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}"