react-with-gesture
Advanced tools
Comparing version 4.0.7 to 4.0.8
@@ -40,3 +40,2 @@ import React from 'react'; | ||
var defaultProps = { | ||
window: window, | ||
touch: true, | ||
@@ -174,9 +173,9 @@ mouse: true, | ||
if (props.mouse) { | ||
props.window.addEventListener(mouseMove, handleMove, props.passive); | ||
props.window.addEventListener(mouseUp, onUp, props.passive); | ||
window.addEventListener(mouseMove, handleMove, props.passive); | ||
window.addEventListener(mouseUp, onUp, props.passive); | ||
} | ||
if (props.touch) { | ||
props.window.addEventListener(touchMove, handleMove, props.passive); | ||
props.window.addEventListener(touchEnd, onUp, props.passive); | ||
window.addEventListener(touchMove, handleMove, props.passive); | ||
window.addEventListener(touchEnd, onUp, props.passive); | ||
} | ||
@@ -189,9 +188,9 @@ | ||
if (props.mouse) { | ||
props.window.removeEventListener(mouseMove, handleMove, props.passive); | ||
props.window.removeEventListener(mouseUp, onUp, props.passive); | ||
window.removeEventListener(mouseMove, handleMove, props.passive); | ||
window.removeEventListener(mouseUp, onUp, props.passive); | ||
} | ||
if (props.touch) { | ||
props.window.removeEventListener(touchMove, handleMove, props.passive); | ||
props.window.removeEventListener(touchEnd, onUp, props.passive); | ||
window.removeEventListener(touchMove, handleMove, props.passive); | ||
window.removeEventListener(touchEnd, onUp, props.passive); | ||
} | ||
@@ -198,0 +197,0 @@ }; |
@@ -46,3 +46,2 @@ 'use strict'; | ||
var defaultProps = { | ||
window: window, | ||
touch: true, | ||
@@ -180,9 +179,9 @@ mouse: true, | ||
if (props.mouse) { | ||
props.window.addEventListener(mouseMove, handleMove, props.passive); | ||
props.window.addEventListener(mouseUp, onUp, props.passive); | ||
window.addEventListener(mouseMove, handleMove, props.passive); | ||
window.addEventListener(mouseUp, onUp, props.passive); | ||
} | ||
if (props.touch) { | ||
props.window.addEventListener(touchMove, handleMove, props.passive); | ||
props.window.addEventListener(touchEnd, onUp, props.passive); | ||
window.addEventListener(touchMove, handleMove, props.passive); | ||
window.addEventListener(touchEnd, onUp, props.passive); | ||
} | ||
@@ -195,9 +194,9 @@ | ||
if (props.mouse) { | ||
props.window.removeEventListener(mouseMove, handleMove, props.passive); | ||
props.window.removeEventListener(mouseUp, onUp, props.passive); | ||
window.removeEventListener(mouseMove, handleMove, props.passive); | ||
window.removeEventListener(mouseUp, onUp, props.passive); | ||
} | ||
if (props.touch) { | ||
props.window.removeEventListener(touchMove, handleMove, props.passive); | ||
props.window.removeEventListener(touchEnd, onUp, props.passive); | ||
window.removeEventListener(touchMove, handleMove, props.passive); | ||
window.removeEventListener(touchEnd, onUp, props.passive); | ||
} | ||
@@ -204,0 +203,0 @@ }; |
17
index.js
@@ -9,3 +9,2 @@ import React from 'react' | ||
const defaultProps = { | ||
window, | ||
touch: true, | ||
@@ -119,8 +118,8 @@ mouse: true, | ||
if (props.mouse) { | ||
props.window.addEventListener(mouseMove, handleMove, props.passive) | ||
props.window.addEventListener(mouseUp, onUp, props.passive) | ||
window.addEventListener(mouseMove, handleMove, props.passive) | ||
window.addEventListener(mouseUp, onUp, props.passive) | ||
} | ||
if (props.touch) { | ||
props.window.addEventListener(touchMove, handleMove, props.passive) | ||
props.window.addEventListener(touchEnd, onUp, props.passive) | ||
window.addEventListener(touchMove, handleMove, props.passive) | ||
window.addEventListener(touchEnd, onUp, props.passive) | ||
} | ||
@@ -133,8 +132,8 @@ | ||
if (props.mouse) { | ||
props.window.removeEventListener(mouseMove, handleMove, props.passive) | ||
props.window.removeEventListener(mouseUp, onUp, props.passive) | ||
window.removeEventListener(mouseMove, handleMove, props.passive) | ||
window.removeEventListener(mouseUp, onUp, props.passive) | ||
} | ||
if (props.touch) { | ||
props.window.removeEventListener(touchMove, handleMove, props.passive) | ||
props.window.removeEventListener(touchEnd, onUp, props.passive) | ||
window.removeEventListener(touchMove, handleMove, props.passive) | ||
window.removeEventListener(touchEnd, onUp, props.passive) | ||
} | ||
@@ -141,0 +140,0 @@ } |
{ | ||
"name": "react-with-gesture", | ||
"version": "4.0.7", | ||
"version": "4.0.8", | ||
"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
157846
902