From 163252c0248502542bb89d57b9518b6dc0408451 Mon Sep 17 00:00:00 2001 From: Chris Malley Date: Thu, 28 Jan 2016 17:43:39 -0700 Subject: [PATCH] stop animation when pageNumber changes, regardless of whether animation is enabled, #222 --- js/Carousel.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/Carousel.js b/js/Carousel.js index b5169b26..6c577408 100644 --- a/js/Carousel.js +++ b/js/Carousel.js @@ -254,10 +254,10 @@ define( function( require ) { previousButton.visible = previousButton.enabled; } - if ( thisCarousel._animationEnabled ) { + // stop any animation that's in progress + scrollTween && scrollTween.stop(); - // stop any animation that's in progress - scrollTween && scrollTween.stop(); + if ( thisCarousel._animationEnabled ) { //TODO replace calls to Tween with a wrapper, see https://github.com/phetsims/tasks/issues/360 // Set up the animation to scroll the items in the carousel.