react-with-gesture
Advanced tools
Comparing version 4.0.6 to 4.0.7
@@ -40,2 +40,3 @@ import React from 'react'; | ||
var defaultProps = { | ||
window: window, | ||
touch: true, | ||
@@ -173,9 +174,9 @@ mouse: true, | ||
if (props.mouse) { | ||
window.addEventListener(mouseMove, handleMove, props.passive); | ||
window.addEventListener(mouseUp, onUp, props.passive); | ||
props.window.addEventListener(mouseMove, handleMove, props.passive); | ||
props.window.addEventListener(mouseUp, onUp, props.passive); | ||
} | ||
if (props.touch) { | ||
window.addEventListener(touchMove, handleMove, props.passive); | ||
window.addEventListener(touchEnd, onUp, props.passive); | ||
props.window.addEventListener(touchMove, handleMove, props.passive); | ||
props.window.addEventListener(touchEnd, onUp, props.passive); | ||
} | ||
@@ -188,9 +189,9 @@ | ||
if (props.mouse) { | ||
window.removeEventListener(mouseMove, handleMove, props.passive); | ||
window.removeEventListener(mouseUp, onUp, props.passive); | ||
props.window.removeEventListener(mouseMove, handleMove, props.passive); | ||
props.window.removeEventListener(mouseUp, onUp, props.passive); | ||
} | ||
if (props.touch) { | ||
window.removeEventListener(touchMove, handleMove, props.passive); | ||
window.removeEventListener(touchEnd, onUp, props.passive); | ||
props.window.removeEventListener(touchMove, handleMove, props.passive); | ||
props.window.removeEventListener(touchEnd, onUp, props.passive); | ||
} | ||
@@ -197,0 +198,0 @@ }; |
@@ -46,2 +46,3 @@ 'use strict'; | ||
var defaultProps = { | ||
window: window, | ||
touch: true, | ||
@@ -179,9 +180,9 @@ mouse: true, | ||
if (props.mouse) { | ||
window.addEventListener(mouseMove, handleMove, props.passive); | ||
window.addEventListener(mouseUp, onUp, props.passive); | ||
props.window.addEventListener(mouseMove, handleMove, props.passive); | ||
props.window.addEventListener(mouseUp, onUp, props.passive); | ||
} | ||
if (props.touch) { | ||
window.addEventListener(touchMove, handleMove, props.passive); | ||
window.addEventListener(touchEnd, onUp, props.passive); | ||
props.window.addEventListener(touchMove, handleMove, props.passive); | ||
props.window.addEventListener(touchEnd, onUp, props.passive); | ||
} | ||
@@ -194,9 +195,9 @@ | ||
if (props.mouse) { | ||
window.removeEventListener(mouseMove, handleMove, props.passive); | ||
window.removeEventListener(mouseUp, onUp, props.passive); | ||
props.window.removeEventListener(mouseMove, handleMove, props.passive); | ||
props.window.removeEventListener(mouseUp, onUp, props.passive); | ||
} | ||
if (props.touch) { | ||
window.removeEventListener(touchMove, handleMove, props.passive); | ||
window.removeEventListener(touchEnd, onUp, props.passive); | ||
props.window.removeEventListener(touchMove, handleMove, props.passive); | ||
props.window.removeEventListener(touchEnd, onUp, props.passive); | ||
} | ||
@@ -203,0 +204,0 @@ }; |
17
index.js
@@ -9,2 +9,3 @@ import React from 'react' | ||
const defaultProps = { | ||
window, | ||
touch: true, | ||
@@ -118,8 +119,8 @@ mouse: true, | ||
if (props.mouse) { | ||
window.addEventListener(mouseMove, handleMove, props.passive) | ||
window.addEventListener(mouseUp, onUp, props.passive) | ||
props.window.addEventListener(mouseMove, handleMove, props.passive) | ||
props.window.addEventListener(mouseUp, onUp, props.passive) | ||
} | ||
if (props.touch) { | ||
window.addEventListener(touchMove, handleMove, props.passive) | ||
window.addEventListener(touchEnd, onUp, props.passive) | ||
props.window.addEventListener(touchMove, handleMove, props.passive) | ||
props.window.addEventListener(touchEnd, onUp, props.passive) | ||
} | ||
@@ -132,8 +133,8 @@ | ||
if (props.mouse) { | ||
window.removeEventListener(mouseMove, handleMove, props.passive) | ||
window.removeEventListener(mouseUp, onUp, props.passive) | ||
props.window.removeEventListener(mouseMove, handleMove, props.passive) | ||
props.window.removeEventListener(mouseUp, onUp, props.passive) | ||
} | ||
if (props.touch) { | ||
window.removeEventListener(touchMove, handleMove, props.passive) | ||
window.removeEventListener(touchEnd, onUp, props.passive) | ||
props.window.removeEventListener(touchMove, handleMove, props.passive) | ||
props.window.removeEventListener(touchEnd, onUp, props.passive) | ||
} | ||
@@ -140,0 +141,0 @@ } |
{ | ||
"name": "react-with-gesture", | ||
"version": "4.0.6", | ||
"version": "4.0.7", | ||
"description": "hoc for receiving gestures", | ||
@@ -5,0 +5,0 @@ "main": "dist/react-with-gesture", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
158036
905