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

Commit

Permalink
fix(carousel): fix conditions for animation
Browse files Browse the repository at this point in the history
- Fix incorrect animation conditions

Closes #4974
Fixes #4972
  • Loading branch information
wesleycho committed Nov 28, 2015
1 parent d8c8767 commit 12a37e0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/carousel/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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';
Expand All @@ -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';
Expand Down

0 comments on commit 12a37e0

Please sign in to comment.