File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -230,26 +230,24 @@ Phaser.Stage.prototype.checkVisibility = function () {
230230 this . _hiddenVar = null ;
231231 }
232232
233- // Does browser support it? If not (like in IE9 or old Android) we need to fall back to blur/focus
234- if ( this . _hiddenVar )
235- {
236- document . addEventListener ( this . _hiddenVar , this . _onChange , false ) ;
237- }
238-
239233 var _this = this ;
240234
241235 this . _onChange = function ( event ) {
242236 return _this . visibilityChange ( event , true ) ;
243237 } ;
244238
239+ // Does browser support it? If not (like in IE9 or old Android) we need to fall back to blur/focus
240+ if ( this . _hiddenVar )
241+ {
242+ document . addEventListener ( this . _hiddenVar , this . _onChange , false ) ;
243+ }
244+
245245 window . onblur = this . _onChange ;
246246 window . onfocus = this . _onChange ;
247247
248248 window . onpagehide = this . _onChange ;
249249 window . onpageshow = this . _onChange ;
250250
251- var _this = this ;
252-
253251 if ( this . game . device . cocoonJSApp )
254252 {
255253 CocoonJS . App . onSuspended . addEventListener ( function ( ) {
You can’t perform that action at this time.
0 commit comments