|
1 | 1 | /** |
2 | | - * @license AngularJS v1.5.0-build.4273+sha.8b27c3f |
| 2 | + * @license AngularJS v1.5.0-build.4274+sha.240d589 |
3 | 3 | * (c) 2010-2015 Google, Inc. http://angularjs.org |
4 | 4 | * License: MIT |
5 | 5 | */ |
@@ -373,12 +373,6 @@ function concatWithSpace(a,b) { |
373 | 373 | return a + ' ' + b; |
374 | 374 | } |
375 | 375 |
|
376 | | -function $$BodyProvider() { |
377 | | - this.$get = ['$document', function($document) { |
378 | | - return jqLite($document[0].body); |
379 | | - }]; |
380 | | -} |
381 | | - |
382 | 376 | var $$rAFSchedulerFactory = ['$$rAF', function($$rAF) { |
383 | 377 | var queue, cancelFn; |
384 | 378 |
|
@@ -1382,16 +1376,25 @@ var $$AnimateCssDriverProvider = ['$$animationProvider', function($$animationPro |
1382 | 1376 | var NG_OUT_ANCHOR_CLASS_NAME = 'ng-anchor-out'; |
1383 | 1377 | var NG_IN_ANCHOR_CLASS_NAME = 'ng-anchor-in'; |
1384 | 1378 |
|
1385 | | - this.$get = ['$animateCss', '$rootScope', '$$AnimateRunner', '$rootElement', '$$body', '$sniffer', '$$jqLite', |
1386 | | - function($animateCss, $rootScope, $$AnimateRunner, $rootElement, $$body, $sniffer, $$jqLite) { |
| 1379 | + function isDocumentFragment(node) { |
| 1380 | + return node.parentNode && node.parentNode.nodeType === 11; |
| 1381 | + } |
| 1382 | + |
| 1383 | + this.$get = ['$animateCss', '$rootScope', '$$AnimateRunner', '$rootElement', '$sniffer', '$$jqLite', '$document', |
| 1384 | + function($animateCss, $rootScope, $$AnimateRunner, $rootElement, $sniffer, $$jqLite, $document) { |
1387 | 1385 |
|
1388 | 1386 | // only browsers that support these properties can render animations |
1389 | 1387 | if (!$sniffer.animations && !$sniffer.transitions) return noop; |
1390 | 1388 |
|
1391 | | - var bodyNode = getDomNode($$body); |
| 1389 | + var bodyNode = $document[0].body; |
1392 | 1390 | var rootNode = getDomNode($rootElement); |
1393 | 1391 |
|
1394 | | - var rootBodyElement = jqLite(bodyNode.parentNode === rootNode ? bodyNode : rootNode); |
| 1392 | + var rootBodyElement = jqLite( |
| 1393 | + // this is to avoid using something that exists outside of the body |
| 1394 | + // we also special case the doc fragement case because our unit test code |
| 1395 | + // appends the $rootElement to the body after the app has been bootstrapped |
| 1396 | + isDocumentFragment(rootNode) || bodyNode.contains(rootNode) ? rootNode : bodyNode |
| 1397 | + ); |
1395 | 1398 |
|
1396 | 1399 | var applyAnimationClasses = applyAnimationClassesFactory($$jqLite); |
1397 | 1400 |
|
@@ -2018,9 +2021,9 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) { |
2018 | 2021 | return (nO.addClass && nO.addClass === cO.removeClass) || (nO.removeClass && nO.removeClass === cO.addClass); |
2019 | 2022 | }); |
2020 | 2023 |
|
2021 | | - this.$get = ['$$rAF', '$rootScope', '$rootElement', '$document', '$$body', '$$HashMap', |
| 2024 | + this.$get = ['$$rAF', '$rootScope', '$rootElement', '$document', '$$HashMap', |
2022 | 2025 | '$$animation', '$$AnimateRunner', '$templateRequest', '$$jqLite', '$$forceReflow', |
2023 | | - function($$rAF, $rootScope, $rootElement, $document, $$body, $$HashMap, |
| 2026 | + function($$rAF, $rootScope, $rootElement, $document, $$HashMap, |
2024 | 2027 | $$animation, $$AnimateRunner, $templateRequest, $$jqLite, $$forceReflow) { |
2025 | 2028 |
|
2026 | 2029 | var activeAnimationsLookup = new $$HashMap(); |
@@ -2480,7 +2483,8 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) { |
2480 | 2483 | } |
2481 | 2484 |
|
2482 | 2485 | function areAnimationsAllowed(element, parentElement, event) { |
2483 | | - var bodyElementDetected = isMatchingElement(element, $$body) || element[0].nodeName === 'HTML'; |
| 2486 | + var bodyElement = jqLite($document[0].body); |
| 2487 | + var bodyElementDetected = isMatchingElement(element, bodyElement) || element[0].nodeName === 'HTML'; |
2484 | 2488 | var rootElementDetected = isMatchingElement(element, $rootElement); |
2485 | 2489 | var parentAnimationDetected = false; |
2486 | 2490 | var animateChildren; |
@@ -2536,7 +2540,7 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) { |
2536 | 2540 | if (!bodyElementDetected) { |
2537 | 2541 | // we also need to ensure that the element is or will be apart of the body element |
2538 | 2542 | // otherwise it is pointless to even issue an animation to be rendered |
2539 | | - bodyElementDetected = isMatchingElement(parentElement, $$body); |
| 2543 | + bodyElementDetected = isMatchingElement(parentElement, bodyElement); |
2540 | 2544 | } |
2541 | 2545 |
|
2542 | 2546 | parentElement = parentElement.parent(); |
@@ -3127,7 +3131,6 @@ var $$AnimationProvider = ['$animateProvider', function($animateProvider) { |
3127 | 3131 |
|
3128 | 3132 | /* global angularAnimateModule: true, |
3129 | 3133 |
|
3130 | | - $$BodyProvider, |
3131 | 3134 | $$AnimateAsyncRunFactory, |
3132 | 3135 | $$rAFSchedulerFactory, |
3133 | 3136 | $$AnimateChildrenDirective, |
@@ -3867,8 +3870,6 @@ var $$AnimationProvider = ['$animateProvider', function($animateProvider) { |
3867 | 3870 | * Click here {@link ng.$animate to learn more about animations with `$animate`}. |
3868 | 3871 | */ |
3869 | 3872 | angular.module('ngAnimate', []) |
3870 | | - .provider('$$body', $$BodyProvider) |
3871 | | - |
3872 | 3873 | .directive('ngAnimateChildren', $$AnimateChildrenDirective) |
3873 | 3874 | .factory('$$rAFScheduler', $$rAFSchedulerFactory) |
3874 | 3875 |
|
|
0 commit comments