intersection-observer 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
- // Exits early if all IntersectionObserver and IntersectionObserverEntry
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
- }(window, document));
741
+ }());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intersection-observer",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "A polyfill for IntersectionObserver",
5
5
  "main": "intersection-observer",
6
6
  "repository": {