(element, parentElement)
| 1542 | } |
| 1543 | |
| 1544 | function animationsDisabled(element, parentElement) { |
| 1545 | if (rootAnimateState.disabled) { |
| 1546 | return true; |
| 1547 | } |
| 1548 | |
| 1549 | if (isMatchingElement(element, $rootElement)) { |
| 1550 | return rootAnimateState.running; |
| 1551 | } |
| 1552 | |
| 1553 | var allowChildAnimations, parentRunningAnimation, hasParent; |
| 1554 | do { |
| 1555 | //the element did not reach the root element which means that it |
| 1556 | //is not apart of the DOM. Therefore there is no reason to do |
| 1557 | //any animations on it |
| 1558 | if (parentElement.length === 0) break; |
| 1559 | |
| 1560 | var isRoot = isMatchingElement(parentElement, $rootElement); |
| 1561 | var state = isRoot ? rootAnimateState : (parentElement.data(NG_ANIMATE_STATE) || {}); |
| 1562 | if (state.disabled) { |
| 1563 | return true; |
| 1564 | } |
| 1565 | |
| 1566 | //no matter what, for an animation to work it must reach the root element |
| 1567 | //this implies that the element is attached to the DOM when the animation is run |
| 1568 | if (isRoot) { |
| 1569 | hasParent = true; |
| 1570 | } |
| 1571 | |
| 1572 | //once a flag is found that is strictly false then everything before |
| 1573 | //it will be discarded and all child animations will be restricted |
| 1574 | if (allowChildAnimations !== false) { |
| 1575 | var animateChildrenFlag = parentElement.data(NG_ANIMATE_CHILDREN); |
| 1576 | if (angular.isDefined(animateChildrenFlag)) { |
| 1577 | allowChildAnimations = animateChildrenFlag; |
| 1578 | } |
| 1579 | } |
| 1580 | |
| 1581 | parentRunningAnimation = parentRunningAnimation || |
| 1582 | state.running || |
| 1583 | (state.last && !state.last.isClassBased); |
| 1584 | } |
| 1585 | while (parentElement = parentElement.parent()); |
| 1586 | |
| 1587 | return !hasParent || (!allowChildAnimations && parentRunningAnimation); |
| 1588 | } |
| 1589 | }]); |
| 1590 | |
| 1591 | $animateProvider.register('', ['$window', '$sniffer', '$timeout', '$$animateReflow', |
no test coverage detected