diff --git a/cocos2d/core/event-manager/CCEventManager.js b/cocos2d/core/event-manager/CCEventManager.js index ac1be793d4..a9639211a1 100644 --- a/cocos2d/core/event-manager/CCEventManager.js +++ b/cocos2d/core/event-manager/CCEventManager.js @@ -26,14 +26,13 @@ var js = require('../platform/js'); require('./CCEventListener'); var ListenerID = cc.EventListener.ListenerID; -var _EventListenerVector = cc._Class.extend({ - - ctor: function () { - this._fixedListeners = []; - this._sceneGraphListeners = []; - this.gt0Index = 0; - }, - +var _EventListenerVector = function () { + this._fixedListeners = []; + this._sceneGraphListeners = []; + this.gt0Index = 0; +}; +_EventListenerVector.prototype = { + constructor: _EventListenerVector, size: function () { return this._fixedListeners.length + this._sceneGraphListeners.length; }, @@ -69,7 +68,7 @@ var _EventListenerVector = cc._Class.extend({ getSceneGraphPriorityListeners: function () { return this._sceneGraphListeners; } -}); +}; var __getListenerID = function (event) { var eventType = cc.Event, type = event.type; diff --git a/cocos2d/core/event-manager/CCTouch.js b/cocos2d/core/event-manager/CCTouch.js index d052c0228c..817216d607 100644 --- a/cocos2d/core/event-manager/CCTouch.js +++ b/cocos2d/core/event-manager/CCTouch.js @@ -32,13 +32,12 @@ * @param {Number} y * @param {Number} id */ -cc.Touch = cc._Class.extend(/** @lends cc.Touch# */{ - - ctor:function (x, y, id) { - this._lastModified = 0; - this.setTouchInfo(id, x, y); - }, - +cc.Touch = function (x, y, id) { + this._lastModified = 0; + this.setTouchInfo(id, x, y); +}; +cc.Touch.prototype = { + constructor: cc.Touch, /** * !#en Returns the current touch location in OpenGL coordinates.、 * !#zh 获取当前触点位置。 @@ -180,4 +179,4 @@ cc.Touch = cc._Class.extend(/** @lends cc.Touch# */{ else this._prevPoint = cc.p(x || 0, y || 0); } -}); \ No newline at end of file +}; \ No newline at end of file