anima-yocto-touch
Advanced tools
Comparing version 3.0.0-beta.1 to 3.0.0-beta.2
{ | ||
"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 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
11668
11
144
0