summaryrefslogtreecommitdiff
path: root/javascripts
diff options
context:
space:
mode:
authorDaniel Beauchamp <daniel.beauchamp@shopify.com>2012-11-14 12:18:25 -0500
committerDaniel Beauchamp <daniel.beauchamp@shopify.com>2012-11-14 12:18:25 -0500
commit837cf50007ef8cbd7ec017d4e8cb67adc5725568 (patch)
tree14b7c4f7ec86a548a9735fd7ea3aa6ecf503a4f6 /javascripts
parent77d859b096362a71306125d590156921e4f0a10d (diff)
Set explicit delay for AnimatedNumber filter. Firefox doesn't run SetInterval unless there is a delay specified. Closes #6
Diffstat (limited to 'javascripts')
-rw-r--r--javascripts/dashing.coffee5
1 files changed, 3 insertions, 2 deletions
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 = {}