Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug causing AnimatedValue to freeze after same value is entered #155

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion javascripts/dashing.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Dashing.AnimatedValue =
else
timer = "interval_#{k}"
num = if (!isNaN(@[k]) && @[k]?) then @[k] else 0
unless @[timer] || num == to
unless @[timer] || `num == to`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@femtogram what about moving the parseFloat to before this line? Otherwise, I think we should leave a comment here so that other developers don't accidentally remove the backticks, and to help if moving away from coffeescript later and having to rewrite this code (see #72). WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh gee, completely missed this. Yes, I think moving the parseFloat was probably the better solution, but I see you've added the change with the note! With a rewrite the note might be helpful to prevent the same bug moving forward.

to = parseFloat(to)
num = parseFloat(num)
up = to > num
Expand Down