From 85b638a6dc4ceea9e8370293db6e66b9d87381da Mon Sep 17 00:00:00 2001 From: Wesley Cho Date: Sat, 28 Nov 2015 06:10:11 -0800 Subject: [PATCH] fix(carousel): fix conditions for animation - Fix incorrect animation conditions --- src/carousel/carousel.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/carousel/carousel.js b/src/carousel/carousel.js index 1b9c8b2fae..1ca932d0a6 100644 --- a/src/carousel/carousel.js +++ b/src/carousel/carousel.js @@ -190,9 +190,8 @@ angular.module('ui.bootstrap.carousel', []) }; $scope.$watch('noTransition', function(noTransition) { - $animate.enabled($element, noTransition); + $animate.enabled($element, !noTransition); }); - }]) .directive('uibCarousel', function() { @@ -255,8 +254,7 @@ function($animate, $animateCss) { return { beforeAddClass: function(element, className, done) { - // Due to transclusion, noTransition property is on parent's scope - if (className === 'active' && !$animate.enabled(element)) { + if (className === 'active' && $animate.enabled(element)) { var stopped = false; var direction = element.data(SLIDE_DIRECTION); var directionClass = direction === 'next' ? 'left' : 'right'; @@ -275,8 +273,7 @@ function($animate, $animateCss) { done(); }, beforeRemoveClass: function (element, className, done) { - // Due to transclusion, noTransition property is on parent's scope - if (className === 'active' && !$animate.enabled(element)) { + if (className === 'active' && $animate.enabled(element)) { var stopped = false; var direction = element.data(SLIDE_DIRECTION); var directionClass = direction === 'next' ? 'left' : 'right';