Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
evenchange4 authored May 31, 2019
1 parent 5854e6d commit f8ccfce
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ let _throttle = require('lodash.throttle')

let supportsPassive = false
try {
if (typeof window === 'undefined') {
return;
if (typeof window !== 'undefined') {
var opts = Object.defineProperty({}, 'passive', {
get: function() {
supportsPassive = true
},
})
window.addEventListener('testPassive', null, opts)
window.removeEventListener('testPassive', null, opts)
}
var opts = Object.defineProperty({}, 'passive', {
get: function() {
supportsPassive = true
},
})
window.addEventListener('testPassive', null, opts)
window.removeEventListener('testPassive', null, opts)
} catch (e) {}

let getPosition = () => {
Expand Down

0 comments on commit f8ccfce

Please sign in to comment.