Check if hidden is available first

This commit is contained in:
Leopoldo Brines 2016-07-20 20:04:25 -04:00
parent b90d7b28f8
commit 1e7cd986ee

View file

@ -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;