mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 22:18:29 +00:00
Remove requestedFullscreenChange and replace with checking the document's fullscreen element
This commit is contained in:
parent
e270d3afd8
commit
cf4a4e2107
1 changed files with 1 additions and 17 deletions
|
@ -346,16 +346,6 @@ var ScaleManager = new Class({
|
|||
*/
|
||||
this._createdFullscreenTarget = false;
|
||||
|
||||
/**
|
||||
* Internal var that keeps track of the user, or the browser, requesting fullscreen changes.
|
||||
*
|
||||
* @name Phaser.Scale.ScaleManager#_requestedFullscreenChange
|
||||
* @type {boolean}
|
||||
* @private
|
||||
* @since 3.16.2
|
||||
*/
|
||||
this._requestedFullscreenChange = false;
|
||||
|
||||
/**
|
||||
* The dirty state of the Scale Manager.
|
||||
* Set if there is a change between the parent size and the current size.
|
||||
|
@ -1238,8 +1228,6 @@ var ScaleManager = new Class({
|
|||
{
|
||||
var fsTarget = this.getFullscreenTarget();
|
||||
|
||||
this._requestedFullscreenChange = true;
|
||||
|
||||
var fsPromise;
|
||||
|
||||
if (fullscreen.keyboard)
|
||||
|
@ -1382,8 +1370,6 @@ var ScaleManager = new Class({
|
|||
|
||||
if (fullscreen.active)
|
||||
{
|
||||
this._requestedFullscreenChange = true;
|
||||
|
||||
document[fullscreen.cancel]();
|
||||
}
|
||||
|
||||
|
@ -1490,12 +1476,10 @@ var ScaleManager = new Class({
|
|||
onFullScreenChange: function ()
|
||||
{
|
||||
// They pressed ESC while in fullscreen mode
|
||||
if (!this._requestedFullscreenChange)
|
||||
if (!(document.fullscreenElement || document.webkitFullscreenElement || document.msFullscreenElement || document.mozFullScreenElement))
|
||||
{
|
||||
this.stopFullscreen();
|
||||
}
|
||||
|
||||
this._requestedFullscreenChange = false;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue