@@ -4,7 +4,6 @@ angular.module('ui.bootstrap.carousel', [])
4
4
var self = this ,
5
5
slides = self . slides = $scope . slides = [ ] ,
6
6
NEW_ANIMATE = angular . version . minor >= 4 ,
7
- NO_TRANSITION = 'uib-noTransition' ,
8
7
SLIDE_DIRECTION = 'uib-slideDirection' ,
9
8
currentIndex = - 1 ,
10
9
currentInterval , isPlaying ;
@@ -200,7 +199,7 @@ angular.module('ui.bootstrap.carousel', [])
200
199
} ;
201
200
202
201
$scope . $watch ( 'noTransition' , function ( noTransition ) {
203
- $element . data ( NO_TRANSITION , noTransition ) ;
202
+ $animate . enabled ( $element , noTransition ) ;
204
203
} ) ;
205
204
206
205
} ] )
@@ -257,8 +256,7 @@ angular.module('ui.bootstrap.carousel', [])
257
256
. animation ( '.item' , [
258
257
'$injector' , '$animate' ,
259
258
function ( $injector , $animate ) {
260
- var NO_TRANSITION = 'uib-noTransition' ,
261
- SLIDE_DIRECTION = 'uib-slideDirection' ,
259
+ var SLIDE_DIRECTION = 'uib-slideDirection' ,
262
260
$animateCss = null ;
263
261
264
262
if ( $injector . has ( '$animateCss' ) ) {
@@ -276,7 +274,7 @@ function ($injector, $animate) {
276
274
beforeAddClass : function ( element , className , done ) {
277
275
// Due to transclusion, noTransition property is on parent's scope
278
276
if ( className == 'active' && element . parent ( ) && element . parent ( ) . parent ( ) &&
279
- ! element . parent ( ) . parent ( ) . data ( NO_TRANSITION ) ) {
277
+ ! $animate . enabled ( element ) ) {
280
278
var stopped = false ;
281
279
var direction = element . data ( SLIDE_DIRECTION ) ;
282
280
var directionClass = direction == 'next' ? 'left' : 'right' ;
@@ -306,7 +304,7 @@ function ($injector, $animate) {
306
304
beforeRemoveClass : function ( element , className , done ) {
307
305
// Due to transclusion, noTransition property is on parent's scope
308
306
if ( className === 'active' && element . parent ( ) && element . parent ( ) . parent ( ) &&
309
- ! element . parent ( ) . parent ( ) . data ( NO_TRANSITION ) ) {
307
+ ! $animate . enabled ( element ) ) {
310
308
var stopped = false ;
311
309
var direction = element . data ( SLIDE_DIRECTION ) ;
312
310
var directionClass = direction == 'next' ? 'left' : 'right' ;
0 commit comments