diff options
Diffstat (limited to 'templates/project/widgets/number')
-rw-r--r-- | templates/project/widgets/number/number.coffee | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/templates/project/widgets/number/number.coffee b/templates/project/widgets/number/number.coffee index c288dd7..645ee7f 100644 --- a/templates/project/widgets/number/number.coffee +++ b/templates/project/widgets/number/number.coffee @@ -17,4 +17,8 @@ class Dashing.Number extends Dashing.Widget onData: (data) -> if data.status - $(@get('node')).addClass("status-#{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}" |