react-easy-swipe
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -87,15 +87,15 @@ (function (global, factory) { | ||
key: 'onSwipeStart', | ||
value: function onSwipeStart() { | ||
console.log('Start swiping...'); | ||
value: function onSwipeStart(event) { | ||
console.log('Start swiping...', event); | ||
} | ||
}, { | ||
key: 'onSwipeMove', | ||
value: function onSwipeMove(position) { | ||
console.log('Moved ' + position.x + ' pixels horizontally'); | ||
console.log('Moved ' + position.y + ' pixels vertically'); | ||
value: function onSwipeMove(position, event) { | ||
console.log('Moved ' + position.x + ' pixels horizontally', event); | ||
console.log('Moved ' + position.y + ' pixels vertically', event); | ||
} | ||
}, { | ||
key: 'onSwipeEnd', | ||
value: function onSwipeEnd() { | ||
console.log('End swiping...'); | ||
value: function onSwipeEnd(event) { | ||
console.log('End swiping...', event); | ||
} | ||
@@ -102,0 +102,0 @@ }, { |
@@ -92,15 +92,15 @@ (function (global, factory) { | ||
key: '_handleSwipeStart', | ||
value: function _handleSwipeStart(e) { | ||
var _e$touches$ = e.touches[0]; | ||
var pageX = _e$touches$.pageX; | ||
var pageY = _e$touches$.pageY; | ||
value: function _handleSwipeStart(event) { | ||
var _event$touches$ = event.touches[0]; | ||
var pageX = _event$touches$.pageX; | ||
var pageY = _event$touches$.pageY; | ||
this.touchStart = { pageX: pageX, pageY: pageY }; | ||
this.props.onSwipeStart(); | ||
this.props.onSwipeStart(event); | ||
} | ||
}, { | ||
key: '_handleSwipeMove', | ||
value: function _handleSwipeMove(e) { | ||
var deltaX = e.touches[0].pageX - this.touchStart.pageX; | ||
var deltaY = e.touches[0].pageY - this.touchStart.pageY; | ||
value: function _handleSwipeMove(event) { | ||
var deltaX = event.touches[0].pageX - this.touchStart.pageX; | ||
var deltaY = event.touches[0].pageY - this.touchStart.pageY; | ||
this.swiping = true; | ||
@@ -113,6 +113,6 @@ | ||
y: deltaY | ||
}); | ||
}, event); | ||
if (shouldPreventDefault) { | ||
e.preventDefault(); | ||
event.preventDefault(); | ||
} | ||
@@ -124,16 +124,16 @@ | ||
key: '_handleSwipeEnd', | ||
value: function _handleSwipeEnd() { | ||
value: function _handleSwipeEnd(event) { | ||
if (this.swiping) { | ||
if (this.touchPosition.deltaX < 0) { | ||
this.props.onSwipeLeft(1); | ||
this.props.onSwipeLeft(1, event); | ||
} else if (this.touchPosition.deltaX > 0) { | ||
this.props.onSwipeRight(1); | ||
this.props.onSwipeRight(1, event); | ||
} | ||
if (this.touchPosition.deltaY < 0) { | ||
this.props.onSwipeUp(1); | ||
this.props.onSwipeUp(1, event); | ||
} else if (this.touchPosition.deltaY > 0) { | ||
this.props.onSwipeDown(1); | ||
this.props.onSwipeDown(1, event); | ||
} | ||
} | ||
this.props.onSwipeEnd(); | ||
this.props.onSwipeEnd(event); | ||
this.touchStart = null; | ||
@@ -140,0 +140,0 @@ this.swiping = false; |
{ | ||
"name": "react-easy-swipe", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "React easy swipe - Easy handler for common touch operations", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
22429
0