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

Commit 2e26815

Browse files
steven-pribilinskiywesleycho
authored andcommitted
fix(carousel): fix reading of noTransition
- Check the correct DOM node for animation settings Closes #4325
1 parent 6f9f1fc commit 2e26815

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: src/carousel/carousel.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ function ($injector, $animate) {
357357
return {
358358
beforeAddClass: function(element, className, done) {
359359
// Due to transclusion, noTransition property is on parent's scope
360-
if (className == 'active' && element.parent() &&
361-
!element.parent().data(NO_TRANSITION)) {
360+
if (className == 'active' && element.parent() && element.parent().parent() &&
361+
!element.parent().parent().data(NO_TRANSITION)) {
362362
var stopped = false;
363363
var direction = element.data(SLIDE_DIRECTION);
364364
var directionClass = direction == 'next' ? 'left' : 'right';
@@ -387,8 +387,8 @@ function ($injector, $animate) {
387387
},
388388
beforeRemoveClass: function (element, className, done) {
389389
// Due to transclusion, noTransition property is on parent's scope
390-
if (className === 'active' && element.parent() &&
391-
!element.parent().data(NO_TRANSITION)) {
390+
if (className === 'active' && element.parent() && element.parent().parent() &&
391+
!element.parent().parent().data(NO_TRANSITION)) {
392392
var stopped = false;
393393
var direction = element.data(SLIDE_DIRECTION);
394394
var directionClass = direction == 'next' ? 'left' : 'right';

0 commit comments

Comments
 (0)