Skip to content

Commit

Permalink
Implemented exitFullscreen().
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Sep 6, 2021
1 parent fc17bda commit 1931a2f
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,26 @@
fullscreenButton.title = 'Press F11 to enter or leave fullscreen mode';
fullscreenButton.addEventListener( 'click', function ( event ) {

if (document.documentElement.requestFullscreen) {
if ( document.fullscreenElement ) {

document.exitFullscreen();
return;

} else if ( document.webkitFullscreenElement /* Safari */ ) {

document.webkitExitFullscreen();
return;

}

if ( document.documentElement.requestFullscreen ) {

document.documentElement.requestFullscreen( { navigationUI: 'hide' } );
} else if (document.documentElement.webkitRequestFullScreen) {

} else if ( document.documentElement.webkitRequestFullScreen /* Safari */ ) {

document.documentElement.webkitRequestFullScreen();

}

}, false );
Expand Down Expand Up @@ -277,7 +293,7 @@
if ( gl ) {

// enable dFdx, dFdy, fwidth
gl.getExtension('OES_standard_derivatives');
gl.getExtension( 'OES_standard_derivatives' );

// Create vertex buffer (2 triangles)

Expand Down

0 comments on commit 1931a2f

Please sign in to comment.