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 choose layout control #1062

Merged
merged 1 commit into from
Apr 16, 2020
Merged

Fix choose layout control #1062

merged 1 commit into from
Apr 16, 2020

Conversation

mingiryu
Copy link
Contributor

Description of proposed changes

What is the goal of this pull request? What does this pull request change?

  • Allow user to change layout after the pause, but prevent the user from changing layout during the animation.

  • Added handleChangeLayoutClicked.
    Defined a helper function to replace the anonymous onClicks functions that are currently in place. This will make sure that the loopRunning constant is valid when the onClick event happens.

Related issue(s)

Fixes #1047
Related to #1047

Testing

What steps should be taken to test the changes you've proposed?

  1. Open localhost:4000/zika
  2. Start the animation.
  3. Try to change the tree layout (e.g. to radial). You shouldn't be able to.
  4. Pause the animation before it finished.
  5. Try to change the tree layout (e.g. to radial). You should be able to.

If you added or changed behavior in the codebase, did you update the tests, or do you need help with this?
I don't think there's a test for this behavior.

Thank you for contributing to Nextstrain!

Allow user to change layout after the pause, but prevent the user from changing layout during the animation.
Added handleChangeLayoutClicked.
Copy link
Member

@jameshadfield jameshadfield left a comment

Choose a reason for hiding this comment

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

Tested and works well. A helper function is definitely cleaner. Thanks!

@jameshadfield jameshadfield merged commit dbb6350 into nextstrain:master Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot change tree layout when animation is paused
2 participants