Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-touch

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-touch - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

5

package.json
{
"name": "vue-touch",
"version": "1.0.2",
"version": "1.1.0",
"main": "vue-touch.js",

@@ -19,2 +19,3 @@ "files": [

"devDependencies": {
"uglify-js": "^2.6.2",
"vue": "^1.0.16",

@@ -24,5 +25,5 @@ "webpack": "^1.12.12"

"scripts": {
"build": "webpack example/example.js example/example.build.js",
"build": "webpack example/example.js example/example.build.js && uglifyjs vue-touch.js -c -m > vue-touch.min.js",
"dev": "webpack --watch example/example.js example/example.build.js"
}
}

23

vue-touch.js

@@ -8,4 +8,4 @@ ;(function () {

var gestures = ['tap', 'pan', 'pinch', 'press', 'rotate', 'swipe']
var directions = ['up', 'down', 'left', 'right', 'horizontal', 'vertical']
var customeEvents = {}
var directions = ['up', 'down', 'left', 'right', 'horizontal', 'vertical', 'all']
var customEvents = {}

@@ -39,5 +39,5 @@ if (!Hammer) {

if (customeEvents[event]) {
if (customEvents[event]) {
// custom event
var custom = customeEvents[event]
var custom = customEvents[event]
recognizerType = custom.type

@@ -87,3 +87,2 @@ recognizer = new Hammer[capitalize(recognizerType)](custom)

var mc = this.mc
var vm = this.vm
var event = this.arg

@@ -95,2 +94,3 @@ // teardown old handler

if (typeof fn !== 'function') {
this.handler = null
console.warn(

@@ -101,3 +101,3 @@ '[vue-touch] invalid handler function for v-touch: ' +

} else {
mc.on(event, fn)
mc.on(event, (this.handler = fn))
}

@@ -107,3 +107,5 @@ },

unbind: function () {
this.mc.off(this.arg, this.handler)
if (this.handler) {
this.mc.off(this.arg, this.handler)
}
if (!Object.keys(this.mc.handlers).length) {

@@ -140,3 +142,3 @@ this.mc.destroy()

options.event = event
customeEvents[event] = options
customEvents[event] = options
}

@@ -151,4 +153,5 @@

if (typeof dir === 'string') {
if (directions.indexOf(dir) > -1) {
options.direction = Hammer['DIRECTION_' + dir.toUpperCase()]
var hammerDirection = 'DIRECTION_' + dir.toUpperCase()
if (directions.indexOf(dir) > -1 && Hammer.hasOwnProperty(hammerDirection)) {
options.direction = Hammer[hammerDirection]
} else {

@@ -155,0 +158,0 @@ console.warn('[vue-touch] invalid direction: ' + dir)

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