native-carousel
Advanced tools
Comparing version 1.0.0 to 1.0.2
{ | ||
"name": "native-carousel", | ||
"version": "1.0.0", | ||
"description": "Native JavaScript dead simple carousel", | ||
"version": "1.0.2", | ||
"description": "Native JavaScript simple carousel", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -6,3 +6,2 @@ /* | ||
import throttle from './throttle.js'; | ||
import {addListener, removeListener} from './moveListeners.js'; | ||
@@ -88,4 +87,6 @@ const defaults = { | ||
if (listenForDrag){ | ||
const coords = this.getPointerCoordinates(e); | ||
this.dragParams = { | ||
...this.getPointerCoordinates(e), | ||
x: coords.x, | ||
y: coords.y, | ||
diff: 0, | ||
@@ -96,4 +97,6 @@ currentLeftPosition: currentLeftPosition | ||
clearInterval(this.animationInterval); | ||
addListener('move', this.onDrag); | ||
addListener('up', this.toggleDrag); | ||
window.addEventListener('mousemove', this.onDrag); | ||
window.addEventListener('touchmove', this.onDrag); | ||
window.addEventListener('mouseup', this.toggleDrag); | ||
window.addEventListener('touchend', this.toggleDrag); | ||
} else { | ||
@@ -104,4 +107,6 @@ this.dragParams = null; | ||
if (this.animate) this.startAnimation(); | ||
removeListener('move', this.onDrag); | ||
removeListener('up', this.toggleDrag); | ||
window.removeEventListener('mousemove', this.onDrag); | ||
window.removeEventListener('touchmove', this.onDrag); | ||
window.removeEventListener('mouseup', this.toggleDrag); | ||
window.removeEventListener('touchend', this.toggleDrag); | ||
} | ||
@@ -108,0 +113,0 @@ } |
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
7009
7
228
0