From 8ff6c47bae190b5b65291b30bc71f3869e79b9ea Mon Sep 17 00:00:00 2001 From: pandamicro Date: Tue, 13 Feb 2018 16:39:45 +0800 Subject: [PATCH] Fix event listeners construction issue --- cocos2d/core/event-manager/CCEventListener.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cocos2d/core/event-manager/CCEventListener.js b/cocos2d/core/event-manager/CCEventListener.js index 32289b70c8..0e70a4bacc 100644 --- a/cocos2d/core/event-manager/CCEventListener.js +++ b/cocos2d/core/event-manager/CCEventListener.js @@ -311,7 +311,7 @@ var ListenerID = cc.EventListener.ListenerID = { var Custom = function (listenerId, callback) { this._onCustomEvent = callback; - cc.EventListener.prototype.ctor.call(this, cc.EventListener.CUSTOM, listenerId, this._callback); + cc.EventListener.call(this, cc.EventListener.CUSTOM, listenerId, this._callback); }; js.extend(Custom, cc.EventListener); js.addon(Custom.prototype, { @@ -332,7 +332,7 @@ js.addon(Custom.prototype, { }); var Mouse = function () { - cc.EventListener.prototype.ctor.call(this, cc.EventListener.MOUSE, ListenerID.MOUSE, this._callback); + cc.EventListener.call(this, cc.EventListener.MOUSE, ListenerID.MOUSE, this._callback); }; js.extend(Mouse, cc.EventListener); js.addon(Mouse.prototype, { @@ -380,7 +380,7 @@ js.addon(Mouse.prototype, { }); var TouchOneByOne = function () { - cc.EventListener.prototype.ctor.call(this, cc.EventListener.TOUCH_ONE_BY_ONE, ListenerID.TOUCH_ONE_BY_ONE, null); + cc.EventListener.call(this, cc.EventListener.TOUCH_ONE_BY_ONE, ListenerID.TOUCH_ONE_BY_ONE, null); this._claimedTouches = []; }; js.extend(TouchOneByOne, cc.EventListener); @@ -421,7 +421,7 @@ js.addon(TouchOneByOne.prototype, { }); var TouchAllAtOnce = function () { - cc.EventListener.prototype.ctor.call(this, cc.EventListener.TOUCH_ALL_AT_ONCE, ListenerID.TOUCH_ALL_AT_ONCE, null); + cc.EventListener.call(this, cc.EventListener.TOUCH_ALL_AT_ONCE, ListenerID.TOUCH_ALL_AT_ONCE, null); }; js.extend(TouchAllAtOnce, cc.EventListener); js.addon(TouchAllAtOnce.prototype, { @@ -453,7 +453,7 @@ js.addon(TouchAllAtOnce.prototype, { //Acceleration var Acceleration = function (callback) { this._onAccelerationEvent = callback; - cc.EventListener.prototype.ctor.call(this, cc.EventListener.ACCELERATION, ListenerID.ACCELERATION, this._callback); + cc.EventListener.call(this, cc.EventListener.ACCELERATION, ListenerID.ACCELERATION, this._callback); }; js.extend(Acceleration, cc.EventListener); js.addon(Acceleration.prototype, { @@ -478,7 +478,7 @@ js.addon(Acceleration.prototype, { //Keyboard var Keyboard = function () { - cc.EventListener.prototype.ctor.call(this, cc.EventListener.KEYBOARD, ListenerID.KEYBOARD, this._callback); + cc.EventListener.call(this, cc.EventListener.KEYBOARD, ListenerID.KEYBOARD, this._callback); }; js.extend(Keyboard, cc.EventListener); js.addon(Keyboard.prototype, {