mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 04:33:31 +00:00
Fix #6885 leave fullscreen event fires twice
This commit is contained in:
parent
c86b5b2528
commit
9f3afafb29
1 changed files with 12 additions and 1 deletions
|
@ -1438,7 +1438,6 @@ var ScaleManager = new Class({
|
|||
* Calling this method will cancel fullscreen mode, if the browser has entered it.
|
||||
*
|
||||
* @method Phaser.Scale.ScaleManager#stopFullscreen
|
||||
* @fires Phaser.Scale.Events#LEAVE_FULLSCREEN
|
||||
* @fires Phaser.Scale.Events#FULLSCREEN_UNSUPPORTED
|
||||
* @since 3.16.0
|
||||
*/
|
||||
|
@ -1459,7 +1458,18 @@ var ScaleManager = new Class({
|
|||
}
|
||||
|
||||
this.removeFullscreenTarget();
|
||||
},
|
||||
|
||||
/**
|
||||
* The browser has successfully left fullscreen mode.
|
||||
*
|
||||
* @method Phaser.Scale.ScaleManager#leaveFullScreenSuccessHandler
|
||||
* @fires Phaser.Scale.Events#LEAVE_FULLSCREEN
|
||||
* @fires Phaser.Scale.Events#FULLSCREEN_UNSUPPORTED
|
||||
* @since 3.85.0
|
||||
*/
|
||||
leaveFullScreenSuccessHandler: function ()
|
||||
{
|
||||
// Get the parent size again as it will have changed
|
||||
this.getParentBounds();
|
||||
|
||||
|
@ -1582,6 +1592,7 @@ var ScaleManager = new Class({
|
|||
{
|
||||
// They pressed ESC while in fullscreen mode
|
||||
this.stopFullscreen();
|
||||
this.leaveFullScreenSuccessHandler();
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue