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.6 to 5.0.7

70

dist/index.js

@@ -262,3 +262,4 @@ // index.js

hasBindTouchEvents: false,
options: globalOptions
options: globalOptions,
events: {}
};

@@ -271,2 +272,18 @@ if (extraOptions) {

}
function addEvents(events) {
for (const eventName in events) {
if (events.hasOwnProperty(eventName)) {
const [target, handler] = events[eventName];
target.addEventListener(eventName, handler);
}
}
}
function removeEvents(events) {
for (const eventName in events) {
if (events.hasOwnProperty(eventName)) {
const [target, handler] = events[eventName];
target.removeEventListener(eventName, handler);
}
}
}
app.directive(globalOptions.namespace, {

@@ -305,15 +322,29 @@ beforeMount: function($el, binding) {

}
var dragEventObj = $this.options.dragOutside ? window : $el;
var dragEventHandler = $this.options.dragOutside ? touchMoveEventWindow : touchMoveEvent;
$el.addEventListener("touchstart", touchStartEvent, passiveOpt);
dragEventObj.addEventListener("touchmove", dragEventHandler, passiveOpt);
dragEventObj.addEventListener("touchcancel", touchCancelEvent);
dragEventObj.addEventListener("touchend", touchEndEvent);
if ($this.options.dragOutside) {
$this.events["touchstart"] = [$el, touchStartEvent];
$this.events["touchmove"] = [window, touchMoveEventWindow.bind(this)];
$this.events["touchcancel"] = [window, touchCancelEvent.bind(this)];
$this.events["touchend"] = [window, touchEndEvent.bind(this)];
} else {
$this.events["touchstart"] = [$el, touchStartEvent];
$this.events["touchmove"] = [$el, touchMoveEventWindow];
$this.events["touchcancel"] = [$el, touchCancelEvent];
$this.events["touchend"] = [$el, touchEndEvent.bind];
}
if (!$this.options.disableClick) {
$el.addEventListener("mousedown", touchStartEvent);
dragEventObj.addEventListener("mousemove", dragEventHandler);
dragEventObj.addEventListener("mouseup", touchEndEvent);
$el.addEventListener("mouseenter", mouseEnterEvent);
$el.addEventListener("mouseleave", mouseLeaveEvent);
if ($this.options.dragOutside) {
$this.events["mousedown"] = [$el, touchStartEvent];
$this.events["mousemove"] = [window, touchMoveEventWindow.bind(this)];
$this.events["mouseup"] = [window, touchEndEvent.bind(this)];
$this.events["mouseenter"] = [$el, mouseEnterEvent];
$this.events["mouseleave"] = [$el, mouseLeaveEvent];
} else {
$this.events["mousedown"] = [$el, touchStartEvent];
$this.events["mousemove"] = [$el, touchMoveEvent];
$this.events["mouseup"] = [$el, touchEndEvent];
$this.events["mouseenter"] = [$el, mouseEnterEvent];
$this.events["mouseleave"] = [$el, mouseLeaveEvent];
}
}
addEvents($this.events);
$this.hasBindTouchEvents = true;

@@ -324,14 +355,5 @@ },

cancelTouchHoldTimer(touchObj);
var dragEventObj = touchObj?.options?.dragOutside ? window : $el;
var dragEventHandler = touchObj?.options?.dragOutside ? touchMoveEventWindow : touchMoveEvent;
$el.removeEventListener("touchstart", touchStartEvent);
dragEventObj.removeEventListener("touchmove", dragEventHandler);
dragEventObj.removeEventListener("touchcancel", touchCancelEvent);
dragEventObj.removeEventListener("touchend", touchEndEvent);
if (touchObj && !touchObj.options.disableClick) {
$el.removeEventListener("mousedown", touchStartEvent);
dragEventObj.addEventListener("mousemove", dragEventHandler);
dragEventObj.removeEventListener("mouseup", touchEndEvent);
$el.removeEventListener("mouseenter", mouseEnterEvent);
$el.removeEventListener("mouseleave", mouseLeaveEvent);
if (touchObj && touchObj.events) {
removeEvents(touchObj.events);
touchObj.events = {};
}

@@ -338,0 +360,0 @@ delete $el.$$touchObj;

{
"name": "vue3-touch-events",
"version": "5.0.6",
"version": "5.0.7",
"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