From 91042968988229bc5dd893178837f523b82ab522 Mon Sep 17 00:00:00 2001 From: VisualSJ Date: Thu, 8 Sep 2016 12:05:37 +0800 Subject: [PATCH] CCEGLView 'this' lose --- cocos2d/core/platform/CCEGLView.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos2d/core/platform/CCEGLView.js b/cocos2d/core/platform/CCEGLView.js index 06adf46fbd..97acc6cdd3 100644 --- a/cocos2d/core/platform/CCEGLView.js +++ b/cocos2d/core/platform/CCEGLView.js @@ -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); + window.addEventListener('orientationchange', this._orientationChange, this); } } else { //disable if (this.__resizeWithBrowserSize) { this.__resizeWithBrowserSize = false; window.removeEventListener('resize', this._resizeEvent); - window.removeEventListener('orientationchange', this._orientationChange); + window.removeEventListener('orientationchange', this._orientationChange, this); } } },