From f21943184674053e4a6f201268d02b3bfc0a266a Mon Sep 17 00:00:00 2001 From: luocong123 <516801125@qq.com> Date: Tue, 10 Nov 2015 16:01:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=8B=E4=BB=B6=E8=A7=A3?= =?UTF-8?q?=E7=BB=91=E6=97=A0=E6=95=88=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit touchjs v0.2.14调用off函数解除事件绑定,发现无效,遂做此提交,本次提交修复了事件不能解绑以及事件委托不能解绑的问题。 --- touch-0.2.14.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/touch-0.2.14.js b/touch-0.2.14.js index 22e9202..ae23f7e 100644 --- a/touch-0.2.14.js +++ b/touch-0.2.14.js @@ -1,4 +1,4 @@ -/*! touchjs v0.2.14 2014-08-05 */ +/*! touchjs v0.2.14 2015-11-10 */ 'use strict'; (function(root, factory) { if (typeof define === 'function' && (define.amd || define.cmd)) { @@ -271,17 +271,17 @@ var engine = { var handlers = el.listeners[evt]; if (handlers && handlers.length) { handlers.forEach(function(handler) { - el.removeEventListener(evt, handler, false); - }); + el.removeEventListener(evt, this.proxies[handler.proxy[evt]], false); + }, this); } } else { var proxyids = handler.proxy[evt]; if (proxyids && proxyids.length) { proxyids.forEach(function(proxyid) { if (el.removeEventListener) { - el.removeEventListener(evt, this.proxies[this.proxyid], false); + el.removeEventListener(evt, this.proxies[proxyid], false); } - }); + }, this); } } }, @@ -354,9 +354,9 @@ var engine = { if (proxyids.length) { proxyids.forEach(function(proxyid) { if (el.removeEventListener) { - el.removeEventListener(evt, this.proxies[this.proxyid], false); + el.removeEventListener(evt, this.proxies[proxyid], false); } - }); + }, this); } } } @@ -974,4 +974,4 @@ var _dispatch = function(el, evt, detail) { exports.trigger = _dispatch; return exports; -})); \ No newline at end of file +}));