New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vue3-touch-events

Package Overview
Dependencies
Maintainers
0
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue3-touch-events - npm Package Compare versions

Comparing version 5.0.9 to 5.0.10

38

dist/index.js

@@ -66,4 +66,5 @@ // index.js

$this.touchStartTime = event.timeStamp;
$this.hasSwipe = hasEvent(this, "swipe") || hasEvent(this, "swipe.left") || hasEvent(this, "swipe.right") || hasEvent(this, "swipe.top") || hasEvent(this, "swipe.bottom");
if (hasEvent(this, "hold")) {
$this.hasSwipe = hasEvent($this, "swipe") || hasEvent($this, "swipe.left") || hasEvent($this, "swipe.right") || hasEvent($this, "swipe.top") || hasEvent($this, "swipe.bottom");
$this.hasZoom = hasEvent($this, "zoom") || hasEvent($this, "zoom.in") || hasEvent($this, "zoom.out");
if (hasEvent($this, "hold")) {
$this.touchHoldTimer = setTimeout(function() {

@@ -95,3 +96,3 @@ $this.touchHoldTimer = null;

cancelTouchHoldTimer($this);
triggerEvent(event, this, "drag.once");
triggerEvent(event, $this.element, "drag.once");
}

@@ -104,17 +105,17 @@ } else if ($this.hasSwipe && !$this.swipeOutBounded) {

}
if (hasEvent(this, "rollover") && movedAgain) {
if (movedAgain && hasEvent($this, "rollover")) {
var now = event.timeStamp;
if ($this.touchRollTime == null || now > $this.touchRollTime + $this.options.rollOverFrequency) {
$this.touchRollTime = now;
triggerEvent(event, this, "rollover");
triggerEvent(event, $this.element, "rollover");
}
}
if (hasEvent(this, "drag") && $this.touchStarted && $this.touchMoved && movedAgain) {
if ($this.touchStarted && $this.touchMoved && movedAgain && hasEvent($this, "drag")) {
var now = event.timeStamp;
if ($this.touchDragTime == null || now > $this.touchDragTime + $this.options.dragFrequency) {
$this.touchDragTime = now;
triggerEvent(event, this, "drag");
triggerEvent(event, $this.element, "drag");
}
}
if ($this.touchStarted && (hasEvent(this, "zoom") || hasEvent(this, "zoom.in") || hasEvent(this, "zoom.out"))) {
if ($this.touchStarted && $this.hasZoom) {
var now = event.timeStamp;

@@ -140,13 +141,13 @@ if ($this.touchZoomTime == null || now > $this.touchZoomTime + $this.options.zoomFrequency) {

const zoomFactor = newDistance / $this.initialZoomDistance;
if (hasEvent(this, "zoom")) {
if (hasEvent($this, "zoom")) {
if (Math.abs(zoomFactor - 1) > $this.options.zoomDistance / $this.initialZoomDistance) {
triggerEvent(event, this, "zoom", zoomFactor);
triggerEvent(event, $this.element, "zoom", zoomFactor);
}
}
if (hasEvent(this, "zoom.in") || hasEvent(this, "zoom.out")) {
if (hasEvent($this, "zoom.in") || hasEvent($this, "zoom.out")) {
if (Math.abs(newDistance - $this.initialZoomDistance) > $this.options.zoomInOutDistance) {
if (newDistance > $this.initialZoomDistance) {
triggerEvent(event, this, "zoom.in");
triggerEvent(event, $this.element, "zoom.in");
} else {
triggerEvent(event, this, "zoom.out");
triggerEvent(event, $this.element, "zoom.out");
}

@@ -183,3 +184,3 @@ }

if (!$this.touchMoved) {
if (hasEvent(this, "longtap") && event.timeStamp - $this.touchStartTime > $this.options.longTapTimeInterval) {
if (hasEvent($this, "longtap") && event.timeStamp - $this.touchStartTime > $this.options.longTapTimeInterval) {
if (event.cancelable) {

@@ -189,3 +190,3 @@ event.preventDefault();

triggerEvent(event, this, "longtap");
} else if (hasEvent(this, "hold") && touchholdEnd) {
} else if (hasEvent($this, "hold") && touchholdEnd) {
if (event.cancelable) {

@@ -206,3 +207,3 @@ event.preventDefault();

}
if (hasEvent(this, "swipe." + direction)) {
if (hasEvent($this, "swipe." + direction)) {
triggerEvent(event, this, "swipe." + direction, direction);

@@ -222,4 +223,4 @@ } else {

}
function hasEvent($el, eventType) {
var callbacks = $el.$$touchObj.callbacks[eventType];
function hasEvent($this, eventType) {
var callbacks = $this.callbacks[eventType];
return callbacks != null && callbacks.length > 0;

@@ -269,2 +270,3 @@ }

var touchObj = $el.$$touchObj || {
element: $el,
callbacks: {},

@@ -271,0 +273,0 @@ hasBindTouchEvents: false,

{
"name": "vue3-touch-events",
"version": "5.0.9",
"version": "5.0.10",
"description": "Simple touch events support for vue.js 3",

@@ -5,0 +5,0 @@ "type": "module",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc