Skip to content

Commit 5a3b825

Browse files
authored
Merge pull request rpgtkoolmv#122 from bungcip/patch-1
fix typo in fullscreen api
2 parents a6b67ea + 99f17d8 commit 5a3b825

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

js/rpg_core/Graphics.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,9 +1256,9 @@ Graphics._switchStretchMode = function() {
12561256
*/
12571257
Graphics._switchFullScreen = function() {
12581258
if (this._isFullScreen()) {
1259-
this._requestFullScreen();
1260-
} else {
12611259
this._cancelFullScreen();
1260+
} else {
1261+
this._requestFullScreen();
12621262
}
12631263
};
12641264

@@ -1269,9 +1269,10 @@ Graphics._switchFullScreen = function() {
12691269
* @private
12701270
*/
12711271
Graphics._isFullScreen = function() {
1272-
return ((document.fullScreenElement && document.fullScreenElement !== null) ||
1273-
(!document.mozFullScreen && !document.webkitFullscreenElement &&
1274-
!document.msFullscreenElement));
1272+
return document.fullscreenElement ||
1273+
document.mozFullScreen ||
1274+
document.webkitFullscreenElement ||
1275+
document.msFullscreenElement;
12751276
};
12761277

12771278
/**
@@ -1281,8 +1282,8 @@ Graphics._isFullScreen = function() {
12811282
*/
12821283
Graphics._requestFullScreen = function() {
12831284
var element = document.body;
1284-
if (element.requestFullScreen) {
1285-
element.requestFullScreen();
1285+
if (element.requestFullscreen) {
1286+
element.requestFullscreen();
12861287
} else if (element.mozRequestFullScreen) {
12871288
element.mozRequestFullScreen();
12881289
} else if (element.webkitRequestFullScreen) {
@@ -1298,8 +1299,8 @@ Graphics._requestFullScreen = function() {
12981299
* @private
12991300
*/
13001301
Graphics._cancelFullScreen = function() {
1301-
if (document.cancelFullScreen) {
1302-
document.cancelFullScreen();
1302+
if (document.exitFullscreen) {
1303+
document.exitFullscreen();
13031304
} else if (document.mozCancelFullScreen) {
13041305
document.mozCancelFullScreen();
13051306
} else if (document.webkitCancelFullScreen) {

0 commit comments

Comments
 (0)