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

anima-yocto-touch

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

anima-yocto-touch - npm Package Compare versions

Comparing version 3.0.0-beta.1 to 3.0.0-beta.2

tests/anima-yocto-touch-spec.js

2

package.json
{
"name": "anima-yocto-touch",
"version": "3.0.0-beta.1",
"version": "3.0.0-beta.2",
"description": "the touch from yocto",

@@ -5,0 +5,0 @@ "keywords": [

@@ -8,10 +8,11 @@ var $ = require('anima-yocto-core');

var self = this,
gesture = self[name];
gesture = self[name] || {},
handler = gesture.handler || {};
function move(event) {
gesture.handler.touchmove(event);
handler.touchmove && handler.touchmove(event);
}
function end(event) {
gesture.handler.touchend(event);
handler.touchend && handler.touchend(event);
document.removeEventListener("touchmove", move, false);

@@ -23,3 +24,3 @@ document.removeEventListener("touchend", end, false);

function cancel(event) {
gesture.handler.touchcancel(event);
handler.touchcancel && handler.touchcancel(event);
document.removeEventListener("touchmove", move, false);

@@ -31,21 +32,16 @@ document.removeEventListener("touchend", end, false);

var bindEvent = function (element) {
var $el = $(element);
if (!element[name]) { //防止同一重复绑定函数
element[name] = true;
el.addEventListener("touchstart", function (event) {
gesture.handler.touchstart(event);
if (!$el.data(name)) { //防止同一重复绑定函数
document.addEventListener("touchmove", move, false);
$el
.data(name, 1)
.forEach(function (el) {
el.addEventListener("touchstart", function (event) {
gesture.handler.touchstart(event);
document.addEventListener("touchend", end, false);
document.addEventListener("touchmove", move, false);
document.addEventListener("touchcancel", cancel, false);
document.addEventListener("touchend", end, false);
document.addEventListener("touchcancel", cancel, false);
// event.preventDefault();
}, false);
});
// event.preventDefault();
}, false);
}

@@ -52,0 +48,0 @@ };

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