Add fullscreen framework

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
2024-11-05 12:12:00 -07:00
parent a3b6aa1418
commit d80c31449b
3 changed files with 40 additions and 3 deletions

View File

@@ -413,4 +413,17 @@ downloadImage = function(defName) {
.then(imgBlob => {
reader.readAsDataURL(imgBlob)
})
}
/**
* Respond to full screen changes on the gl container
*
* @param {Element} glCont container element to enlarge or reduce
*/
toggleFullScreen = function(glCont) {
if (document.fullscreenElement) {
document.exitFullscreen()
} else {
glCont.requestFullscreen()
}
}