intersection-observer 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/intersection-observer.js +13 -4
- package/package.json +1 -1
package/intersection-observer.js
CHANGED
@@ -6,12 +6,15 @@
|
|
6
6
|
* https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
|
7
7
|
*
|
8
8
|
*/
|
9
|
-
|
10
|
-
(function(window, document) {
|
9
|
+
(function() {
|
11
10
|
'use strict';
|
12
11
|
|
12
|
+
// Exit early if we're not running in a browser.
|
13
|
+
if (typeof window !== 'object') {
|
14
|
+
return;
|
15
|
+
}
|
13
16
|
|
14
|
-
//
|
17
|
+
// Exit early if all IntersectionObserver and IntersectionObserverEntry
|
15
18
|
// features are natively supported.
|
16
19
|
if ('IntersectionObserver' in window &&
|
17
20
|
'IntersectionObserverEntry' in window &&
|
@@ -31,6 +34,12 @@ if ('IntersectionObserver' in window &&
|
|
31
34
|
}
|
32
35
|
|
33
36
|
|
37
|
+
/**
|
38
|
+
* A local reference to the document.
|
39
|
+
*/
|
40
|
+
var document = window.document;
|
41
|
+
|
42
|
+
|
34
43
|
/**
|
35
44
|
* An IntersectionObserver registry. This registry exists to hold a strong
|
36
45
|
* reference to IntersectionObserver instances currently observing a target
|
@@ -729,4 +738,4 @@ function getParentNode(node) {
|
|
729
738
|
window.IntersectionObserver = IntersectionObserver;
|
730
739
|
window.IntersectionObserverEntry = IntersectionObserverEntry;
|
731
740
|
|
732
|
-
}(
|
741
|
+
}());
|