mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 23:20:59 +00:00
Check if hidden is available first
This commit is contained in:
parent
b90d7b28f8
commit
1e7cd986ee
1 changed files with 5 additions and 5 deletions
|
@ -226,7 +226,11 @@ Phaser.Stage.prototype.updateTransform = function () {
|
|||
*/
|
||||
Phaser.Stage.prototype.checkVisibility = function () {
|
||||
|
||||
if (document.webkitHidden !== undefined)
|
||||
if (document.hidden !== undefined)
|
||||
{
|
||||
this._hiddenVar = 'visibilitychange';
|
||||
}
|
||||
else if (document.webkitHidden !== undefined)
|
||||
{
|
||||
this._hiddenVar = 'webkitvisibilitychange';
|
||||
}
|
||||
|
@ -238,10 +242,6 @@ Phaser.Stage.prototype.checkVisibility = function () {
|
|||
{
|
||||
this._hiddenVar = 'msvisibilitychange';
|
||||
}
|
||||
else if (document.hidden !== undefined)
|
||||
{
|
||||
this._hiddenVar = 'visibilitychange';
|
||||
}
|
||||
else
|
||||
{
|
||||
this._hiddenVar = null;
|
||||
|
|
Loading…
Reference in a new issue