From 1e7cd986eea1cd6315f227572c1141827a08d995 Mon Sep 17 00:00:00 2001 From: Leopoldo Brines Date: Wed, 20 Jul 2016 20:04:25 -0400 Subject: [PATCH] Check if hidden is available first --- src/core/Stage.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/Stage.js b/src/core/Stage.js index 0f227fdc2..77046ad48 100644 --- a/src/core/Stage.js +++ b/src/core/Stage.js @@ -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;