We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5854e6d commit f8ccfceCopy full SHA for f8ccfce
index.js
@@ -4,16 +4,15 @@ let _throttle = require('lodash.throttle')
4
5
let supportsPassive = false
6
try {
7
- if (typeof window === 'undefined') {
8
- return;
+ if (typeof window !== 'undefined') {
+ var opts = Object.defineProperty({}, 'passive', {
9
+ get: function() {
10
+ supportsPassive = true
11
+ },
12
+ })
13
+ window.addEventListener('testPassive', null, opts)
14
+ window.removeEventListener('testPassive', null, opts)
15
}
- var opts = Object.defineProperty({}, 'passive', {
- get: function() {
- supportsPassive = true
- },
- })
- window.addEventListener('testPassive', null, opts)
16
- window.removeEventListener('testPassive', null, opts)
17
} catch (e) {}
18
19
let getPosition = () => {
0 commit comments