Skip to content

Commit 0765fc0

Browse files
authored
Merge pull request #3373 from VisualSJ/develop_view
CCEGLView 'this' lose
2 parents 79a5851 + bc3e3a3 commit 0765fc0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cocos2d/core/platform/CCEGLView.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{
228228
},
229229

230230
_orientationChange: function () {
231-
this._orientationChanging = true;
232-
this._resizeEvent();
231+
cc.view._orientationChanging = true;
232+
cc.view._resizeEvent();
233233
},
234234

235235
/**
@@ -267,14 +267,14 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{
267267
if (!this.__resizeWithBrowserSize) {
268268
this.__resizeWithBrowserSize = true;
269269
window.addEventListener('resize', this._resizeEvent);
270-
window.addEventListener('orientationchange', this._orientationChange, this);
270+
window.addEventListener('orientationchange', this._orientationChange);
271271
}
272272
} else {
273273
//disable
274274
if (this.__resizeWithBrowserSize) {
275275
this.__resizeWithBrowserSize = false;
276276
window.removeEventListener('resize', this._resizeEvent);
277-
window.removeEventListener('orientationchange', this._orientationChange, this);
277+
window.removeEventListener('orientationchange', this._orientationChange);
278278
}
279279
}
280280
},

0 commit comments

Comments
 (0)