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

Commit 8359d73

Browse files
committed
fix(carousel): fix animation direction
- Properly fix the animation direction of the slides Closes #4092 Fixes #4087
1 parent 3584061 commit 8359d73

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/carousel/carousel.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,15 @@ angular.module('ui.bootstrap.carousel', [])
4040
if ($animate.enabled() && !$scope.noTransition && !$scope.$currentTransition &&
4141
slide.$element) {
4242
slide.$element.data(SLIDE_DIRECTION, slide.direction);
43+
if (self.currentSlide && self.currentSlide.$element) {
44+
self.currentSlide.$element.data(SLIDE_DIRECTION, slide.direction);
45+
}
46+
4347
$scope.$currentTransition = true;
4448
if (ANIMATE_CSS) {
4549
$animate.on('addClass', slide.$element, function (element, phase) {
46-
$scope.$currentTransition = null;
47-
if (!$scope.$currentTransition) {
50+
if (phase === 'close') {
51+
$scope.$currentTransition = null;
4852
$animate.off('addClass', element);
4953
}
5054
});
@@ -157,12 +161,6 @@ angular.module('ui.bootstrap.carousel', [])
157161
};
158162

159163
self.addSlide = function(slide, element) {
160-
// add default direction for initial transition
161-
// necessary for angular 1.4+
162-
if (!slides.length && element) {
163-
element.data(SLIDE_DIRECTION, 'next');
164-
}
165-
166164
slide.$element = element;
167165
slides.push(slide);
168166
//if this is the first slide or the slide is set to active, select it

0 commit comments

Comments
 (0)