From 2ff031509ce36a9d8547c1460e87ba63b6993153 Mon Sep 17 00:00:00 2001 From: wenber Date: Wed, 19 Aug 2015 12:31:38 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9EAction=E4=B8=ADleave?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E9=87=8C=E8=B0=83=E7=94=A8Action.prototype.d?= =?UTF-8?q?ispose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Action.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Action.js b/src/Action.js index 78323c4..f40cd23 100644 --- a/src/Action.js +++ b/src/Action.js @@ -283,6 +283,15 @@ define( this.view = null; } + /** + * 如果Action本身也有dispose方法,则执行 + * 主要用来dispose掉一些DOM事就绑定,因为我们经常在Action中通过bindEvent来绑定DOM事件 + * 而destroyEvents只能dispose掉er事件 + */ + if (typeof this.dispose === 'function') { + this.dispose(); + } + /** * @event leave * From 3d3afb050636ab7f6f572f673e6c7688f8486c61 Mon Sep 17 00:00:00 2001 From: wenber Date: Tue, 1 Sep 2015 14:22:29 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9er/Action=20dispose?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E8=B0=83=E7=94=A8=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Action.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Action.js b/src/Action.js index f40cd23..75e3080 100644 --- a/src/Action.js +++ b/src/Action.js @@ -285,8 +285,6 @@ define( /** * 如果Action本身也有dispose方法,则执行 - * 主要用来dispose掉一些DOM事就绑定,因为我们经常在Action中通过bindEvent来绑定DOM事件 - * 而destroyEvents只能dispose掉er事件 */ if (typeof this.dispose === 'function') { this.dispose();