Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -4556,15 +4556,15 @@ GA.plugins = function(ga) {
//`requestFullscreen` is used by `enableFullscreen` to launch
//fullscreen mode.
ga.requestFullScreen = function() {
if (!document.fullscreenEnabled) {
if (document.fullscreenEnabled && document.fullscreenElement === null) {
ga.canvas.requestFullscreen();
}
};

//`exitFullscreen` is used by `enableFullscreen` to exit
//fullscreen mode.
ga.exitFullScreen = function() {
if (document.fullscreenEnabled) {
if (document.fullscreenEnabled && document.fullscreenElement !== null) {
document.exitFullscreen();
}
};
Expand Down Expand Up @@ -4695,7 +4695,7 @@ GA.plugins = function(ga) {
//to `fullscreen.scale`. If not, and the canvas hasn't already
//been scaled, the scale reverts back to 1.
ga.scaleFullscreen = function() {
if(document.fullscreenEnabled) {
if(document.fullscreenElement != null) {
ga.scale = ga.fullscreenScale;
ga.pointer.scale = ga.fullscreenScale;
} else {
Expand Down