Created
October 26, 2013 14:23
-
-
Save matsko/7170010 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function animationsDisabled(element, parent) { | |
if(element == $rootElement) { | |
return rootAnimateState.disabled || rootAnimateState.running; | |
} | |
var validState; | |
do { | |
//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) return true; | |
var isDoc = parent[0] == $document[0]; | |
var state = isDoc ? rootAnimateState : parent.data(NG_ANIMATE_STATE); | |
if(state && (state.disabled != null || state.running != null)) { | |
validState = state; | |
break; | |
} | |
if(isDoc) return true; | |
} | |
while(parent = parent.parent()); | |
return validState ? (validState.disabled || validState.running) : true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment