File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 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# */{
184184 _t . _rpFixedWidth = new cc . ResolutionPolicy ( _strategyer . EQUAL_TO_FRAME , _strategy . FIXED_WIDTH ) ;
185185
186186 _t . _targetDensityDPI = cc . DENSITYDPI_HIGH ;
187+
188+ if ( sys . isMobile ) {
189+ window . addEventListener ( 'orientationchange' , this . _orientationChange ) ;
190+ }
187191 } ,
188192
189193 // Resize helper functions
@@ -276,14 +280,12 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{
276280 if ( ! this . __resizeWithBrowserSize ) {
277281 this . __resizeWithBrowserSize = true ;
278282 window . addEventListener ( 'resize' , this . _resizeEvent ) ;
279- window . addEventListener ( 'orientationchange' , this . _orientationChange ) ;
280283 }
281284 } else {
282285 //disable
283286 if ( this . __resizeWithBrowserSize ) {
284287 this . __resizeWithBrowserSize = false ;
285288 window . removeEventListener ( 'resize' , this . _resizeEvent ) ;
286- window . removeEventListener ( 'orientationchange' , this . _orientationChange ) ;
287289 }
288290 }
289291 } ,
You can’t perform that action at this time.
0 commit comments