anima-yocto-event
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -14,1 +14,5 @@ # History | ||
`remove` delegate,undelegate,bind,unbind,live,die | ||
## 1.0.2 | ||
`new` 事件监听阶段,增加animaClick判断以及touch逻辑 |
{ | ||
"name": "anima-yocto-event", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "the event from yocto", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
var $ = require('anima-yocto-core'); | ||
// Event Module | ||
var _zid = 1, undefined, | ||
@@ -54,2 +53,16 @@ slice = Array.prototype.slice, | ||
handler.proxy = function(e){ | ||
//Android下如果同时存在tap逻辑并且事件类型为click,阻止浏览器自己触发的点击事件 | ||
if (navigator.userAgent.toLowerCase().indexOf('android') > -1 && $.gestures && $.gestures.tap && handler.e === 'click' && !e.animaClick) { | ||
if (e.stopImmediatePropagation) { | ||
e.stopImmediatePropagation(); | ||
} else { | ||
e.propagationStopped = true; | ||
} | ||
e.stopPropagation() | ||
e.preventDefault() | ||
return false | ||
} | ||
e = compatible(e) | ||
@@ -64,4 +77,10 @@ if (e.isImmediatePropagationStopped()) return | ||
set.push(handler) | ||
if ('addEventListener' in element) | ||
if ('addEventListener' in element){ | ||
// 自定义手势逻辑 | ||
if($.gestures && $.gestures.list && $.gestures.list[handler.e]){ | ||
$.gestures.list[handler.e](element); | ||
} | ||
element.addEventListener(handler.e, handler.proxy, eventCapture(handler, capture)) | ||
} | ||
}) | ||
@@ -152,7 +171,2 @@ } | ||
// 自定义手势逻辑 | ||
if($.gestures && $.gestures.list && $.gestures.list[event]){ | ||
$.gestures.list[event]($this); | ||
} | ||
return $this.each(function(_, element){ | ||
@@ -159,0 +173,0 @@ if (one) autoRemove = function(e){ |
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
9635
227