Created
April 21, 2017 22:16
-
-
Save yhancik/ca9458ab339a6bfe368f90d4c509df0a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// fullscreen stuff | |
var fullscreenButton = document.getElementById("fullscreen-button"); | |
var fullscreenDiv = document.getElementById("crtCanvas"); | |
var fullscreenFunc = fullscreenDiv.requestFullscreen; | |
if (!fullscreenFunc) { | |
['mozRequestFullScreen', | |
'msRequestFullscreen', | |
'webkitRequestFullScreen'].forEach(function (req) { | |
fullscreenFunc = fullscreenFunc || fullscreenDiv[req]; | |
}); | |
} | |
function enterFullscreen() { | |
fullscreenFunc.call(fullscreenDiv); | |
} | |
fullscreenButton.addEventListener('click', enterFullscreen); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment