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

Commit

Permalink
fix(carousel): fix reading of noTransition
Browse files Browse the repository at this point in the history
- Check the correct DOM node for animation settings

Closes #4325
  • Loading branch information
steven-pribilinskiy authored and wesleycho committed Oct 3, 2015
1 parent 6f9f1fc commit 2e26815
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/carousel/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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';
Expand Down

0 comments on commit 2e26815

Please sign in to comment.