File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,10 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{
184
184
_t . _rpFixedWidth = new cc . ResolutionPolicy ( _strategyer . EQUAL_TO_FRAME , _strategy . FIXED_WIDTH ) ;
185
185
186
186
_t . _targetDensityDPI = cc . DENSITYDPI_HIGH ;
187
+
188
+ if ( sys . isMobile ) {
189
+ window . addEventListener ( 'orientationchange' , this . _orientationChange ) ;
190
+ }
187
191
} ,
188
192
189
193
// Resize helper functions
@@ -276,14 +280,12 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{
276
280
if ( ! this . __resizeWithBrowserSize ) {
277
281
this . __resizeWithBrowserSize = true ;
278
282
window . addEventListener ( 'resize' , this . _resizeEvent ) ;
279
- window . addEventListener ( 'orientationchange' , this . _orientationChange ) ;
280
283
}
281
284
} else {
282
285
//disable
283
286
if ( this . __resizeWithBrowserSize ) {
284
287
this . __resizeWithBrowserSize = false ;
285
288
window . removeEventListener ( 'resize' , this . _resizeEvent ) ;
286
- window . removeEventListener ( 'orientationchange' , this . _orientationChange ) ;
287
289
}
288
290
}
289
291
} ,
You can’t perform that action at this time.
0 commit comments