Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit 12a37e0

Browse files
committed
fix(carousel): fix conditions for animation
- Fix incorrect animation conditions Closes #4974 Fixes #4972
1 parent d8c8767 commit 12a37e0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/carousel/carousel.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,8 @@ angular.module('ui.bootstrap.carousel', [])
190190
};
191191

192192
$scope.$watch('noTransition', function(noTransition) {
193-
$animate.enabled($element, noTransition);
193+
$animate.enabled($element, !noTransition);
194194
});
195-
196195
}])
197196

198197
.directive('uibCarousel', function() {
@@ -255,8 +254,7 @@ function($animate, $animateCss) {
255254

256255
return {
257256
beforeAddClass: function(element, className, done) {
258-
// Due to transclusion, noTransition property is on parent's scope
259-
if (className === 'active' && !$animate.enabled(element)) {
257+
if (className === 'active' && $animate.enabled(element)) {
260258
var stopped = false;
261259
var direction = element.data(SLIDE_DIRECTION);
262260
var directionClass = direction === 'next' ? 'left' : 'right';
@@ -275,8 +273,7 @@ function($animate, $animateCss) {
275273
done();
276274
},
277275
beforeRemoveClass: function (element, className, done) {
278-
// Due to transclusion, noTransition property is on parent's scope
279-
if (className === 'active' && !$animate.enabled(element)) {
276+
if (className === 'active' && $animate.enabled(element)) {
280277
var stopped = false;
281278
var direction = element.data(SLIDE_DIRECTION);
282279
var directionClass = direction === 'next' ? 'left' : 'right';

0 commit comments

Comments
 (0)