From 837cf50007ef8cbd7ec017d4e8cb67adc5725568 Mon Sep 17 00:00:00 2001 From: Daniel Beauchamp Date: Wed, 14 Nov 2012 12:18:25 -0500 Subject: Set explicit delay for AnimatedNumber filter. Firefox doesn't run SetInterval unless there is a delay specified. Closes #6 --- javascripts/dashing.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'javascripts') diff --git a/javascripts/dashing.coffee b/javascripts/dashing.coffee index d6d7e22..6662725 100644 --- a/javascripts/dashing.coffee +++ b/javascripts/dashing.coffee @@ -70,7 +70,7 @@ Dashing.AnimatedValue = num = parseFloat(num) up = to > num num_interval = Math.abs(num - to) / 90 - @[timer] = + @[timer] = setInterval => num = if up then Math.ceil(num+num_interval) else Math.floor(num-num_interval) if (up && num > to) || (!up && num < to) @@ -80,7 +80,8 @@ Dashing.AnimatedValue = delete @[timer] @[k] = num @set k, to - @[k] = num + , 10 + @[k] = num Dashing.widgets = widgets = {} Dashing.lastEvents = lastEvents = {} -- cgit v1.2.3