diff options
Diffstat (limited to 'javascripts/dashing.coffee')
-rw-r--r-- | javascripts/dashing.coffee | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/javascripts/dashing.coffee b/javascripts/dashing.coffee index 528ae2c..8852c1e 100644 --- a/javascripts/dashing.coffee +++ b/javascripts/dashing.coffee @@ -59,12 +59,14 @@ class Dashing.Widget extends Batman.View Dashing.AnimatedValue = get: Batman.Property.defaultAccessor.get set: (k, to) -> - if isNaN(to) + if !to? || isNaN(to) @[k] = to else timer = "interval_#{k}" - num = if !isNaN(@[k]) then @[k] else 0 + num = if (!isNaN(@[k]) && @[k]?) then @[k] else 0 unless @[timer] || num == to + to = parseFloat(to) + num = parseFloat(num) up = to > num num_interval = Math.abs(num - to) / 90 @[timer] = |