From 2e268151e281535593f1c3d4f24d74453861bd18 Mon Sep 17 00:00:00 2001 From: Steven Pribilinskiy Date: Wed, 2 Sep 2015 00:29:09 +0300 Subject: [PATCH] fix(carousel): fix reading of `noTransition` - Check the correct DOM node for animation settings Closes #4325 --- src/carousel/carousel.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/carousel/carousel.js b/src/carousel/carousel.js index e080973e4b..305e5293f6 100644 --- a/src/carousel/carousel.js +++ b/src/carousel/carousel.js @@ -357,8 +357,8 @@ function ($injector, $animate) { return { beforeAddClass: function(element, className, done) { // Due to transclusion, noTransition property is on parent's scope - if (className == 'active' && element.parent() && - !element.parent().data(NO_TRANSITION)) { + if (className == 'active' && element.parent() && element.parent().parent() && + !element.parent().parent().data(NO_TRANSITION)) { var stopped = false; var direction = element.data(SLIDE_DIRECTION); var directionClass = direction == 'next' ? 'left' : 'right'; @@ -387,8 +387,8 @@ function ($injector, $animate) { }, beforeRemoveClass: function (element, className, done) { // Due to transclusion, noTransition property is on parent's scope - if (className === 'active' && element.parent() && - !element.parent().data(NO_TRANSITION)) { + if (className === 'active' && element.parent() && element.parent().parent() && + !element.parent().parent().data(NO_TRANSITION)) { var stopped = false; var direction = element.data(SLIDE_DIRECTION); var directionClass = direction == 'next' ? 'left' : 'right';