aboutsummaryrefslogtreecommitdiffstats
path: root/src/ngAnimate/animate.js
diff options
context:
space:
mode:
authorMatias Niemelä2013-10-28 10:43:41 -0600
committerMatias Niemelä2013-10-28 14:26:07 -0700
commit6818542c694aec6c811fb2fe2f86f7d16544c39b (patch)
tree74088780d34d9abb452294e36fba27e9c442cba3 /src/ngAnimate/animate.js
parent74848307443c00ab07552336c56ddfa1e9ef6eff (diff)
downloadangular.js-6818542c694aec6c811fb2fe2f86f7d16544c39b.tar.bz2
fix($animate): ensure enable/disable animations work when the document node is used
Closes #4669
Diffstat (limited to 'src/ngAnimate/animate.js')
-rw-r--r--src/ngAnimate/animate.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ngAnimate/animate.js b/src/ngAnimate/animate.js
index d0cc5aa6..b2b88d0a 100644
--- a/src/ngAnimate/animate.js
+++ b/src/ngAnimate/animate.js
@@ -705,13 +705,16 @@ angular.module('ngAnimate', ['ng'])
//the element did not reach the root element which means that it
//is not apart of the DOM. Therefore there is no reason to do
//any animations on it
- if(parent.length === 0 || parent[0] == $document[0]) return true;
+ if(parent.length === 0) return true;
- var state = parent.data(NG_ANIMATE_STATE);
+ var isRoot = parent[0] == $rootElement[0];
+ var state = isRoot ? rootAnimateState : parent.data(NG_ANIMATE_STATE);
if(state && (state.disabled != null || state.running != null)) {
validState = state;
break;
}
+
+ if(isRoot) return true;
}
while(parent = parent.parent());