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

fix(carousel): fix conditions for animation #4974

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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