From bc3e3a32bc941acc119646dae40afcaf37e6c8ab Mon Sep 17 00:00:00 2001 From: VisualSJ Date: Thu, 8 Sep 2016 14:07:26 +0800 Subject: [PATCH] CCEGLView 'this' lose --- cocos2d/core/platform/CCEGLView.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cocos2d/core/platform/CCEGLView.js b/cocos2d/core/platform/CCEGLView.js index 97acc6cdd3..5333691120 100644 --- a/cocos2d/core/platform/CCEGLView.js +++ b/cocos2d/core/platform/CCEGLView.js @@ -228,8 +228,8 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{ }, _orientationChange: function () { - this._orientationChanging = true; - this._resizeEvent(); + cc.view._orientationChanging = true; + cc.view._resizeEvent(); }, /** @@ -267,14 +267,14 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{ if (!this.__resizeWithBrowserSize) { this.__resizeWithBrowserSize = true; window.addEventListener('resize', this._resizeEvent); - window.addEventListener('orientationchange', this._orientationChange, this); + window.addEventListener('orientationchange', this._orientationChange); } } else { //disable if (this.__resizeWithBrowserSize) { this.__resizeWithBrowserSize = false; window.removeEventListener('resize', this._resizeEvent); - window.removeEventListener('orientationchange', this._orientationChange, this); + window.removeEventListener('orientationchange', this._orientationChange); } } },