Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 3c37b5e

Browse files
committed
chore: replace jqLite($document[0].body) with $body
1 parent a4072d6 commit 3c37b5e

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/ngAnimate/animateCssDriver.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ var $$AnimateCssDriverProvider = ['$$animationProvider', function($$animationPro
99
var NG_OUT_ANCHOR_CLASS_NAME = 'ng-anchor-out';
1010
var NG_IN_ANCHOR_CLASS_NAME = 'ng-anchor-in';
1111

12-
this.$get = ['$animateCss', '$rootScope', '$$AnimateRunner', '$rootElement', '$document', '$sniffer',
13-
function($animateCss, $rootScope, $$AnimateRunner, $rootElement, $document, $sniffer) {
12+
this.$get = ['$animateCss', '$rootScope', '$$AnimateRunner', '$rootElement', '$body', '$sniffer',
13+
function($animateCss, $rootScope, $$AnimateRunner, $rootElement, $body, $sniffer) {
1414

1515
// only browsers that support these properties can render animations
1616
if (!$sniffer.animations && !$sniffer.transitions) return noop;
1717

18-
var bodyNode = getDomNode($document).body;
18+
var bodyNode = getDomNode($body);
1919
var rootNode = getDomNode($rootElement);
2020

2121
var rootBodyElement = jqLite(bodyNode.parentNode === rootNode ? bodyNode : rootNode);

src/ngAnimate/animateQueue.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
6666
return (nO.addClass && nO.addClass === cO.removeClass) || (nO.removeClass && nO.removeClass === cO.addClass);
6767
});
6868

69-
this.$get = ['$$rAF', '$rootScope', '$rootElement', '$document', '$$HashMap',
69+
this.$get = ['$$rAF', '$rootScope', '$rootElement', '$document', '$body', '$$HashMap',
7070
'$$animation', '$$AnimateRunner', '$templateRequest', '$$jqLite',
71-
function($$rAF, $rootScope, $rootElement, $document, $$HashMap,
71+
function($$rAF, $rootScope, $rootElement, $document, $body, $$HashMap,
7272
$$animation, $$AnimateRunner, $templateRequest, $$jqLite) {
7373

7474
var activeAnimationsLookup = new $$HashMap();
@@ -105,8 +105,6 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
105105
}
106106
);
107107

108-
var bodyElement = jqLite($document[0].body);
109-
110108
var callbackRegistry = {};
111109

112110
// remember that the classNameFilter is set during the provider/config
@@ -580,7 +578,7 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
580578
if (!bodyElementDetected) {
581579
// we also need to ensure that the element is or will be apart of the body element
582580
// otherwise it is pointless to even issue an animation to be rendered
583-
bodyElementDetected = isMatchingElement(parentElement, bodyElement);
581+
bodyElementDetected = isMatchingElement(parentElement, $body);
584582
}
585583

586584
parentElement = parentElement.parent();

0 commit comments

Comments
 (0)