Add event handlers to update text when user exits full screen by pressing 'Esc'.
This commit is contained in:
parent
f59f6b9744
commit
7d7d8951a5
@ -302,10 +302,10 @@ $(document).bind("pageinit", function() {
|
||||
/**************
|
||||
* gui stuff *
|
||||
**************/
|
||||
|
||||
function toggleFullscreen() {
|
||||
if (isMobileSafari) { alert ("To get this app in Full Screen, you have to add it to your home-screen using the Share button."); exit(); }
|
||||
if (!document.fullscreenElement && // alternative standard method
|
||||
!document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement ) { // current working methods
|
||||
if (!isFullscreen() ) { // current working methods
|
||||
var docElm = document.documentElement;
|
||||
if (docElm.requestFullscreen) {
|
||||
docElm.requestFullscreen();
|
||||
@ -316,7 +316,6 @@ function toggleFullscreen() {
|
||||
} else if (docElm.webkitRequestFullScreen) {
|
||||
docElm.webkitRequestFullScreen();
|
||||
}
|
||||
document.getElementById("toggletxt").innerHTML = "Exit Fullscreen";
|
||||
} else {
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
@ -327,10 +326,14 @@ function toggleFullscreen() {
|
||||
} else if (document.webkitCancelFullScreen) {
|
||||
document.webkitCancelFullScreen();
|
||||
}
|
||||
document.getElementById("toggletxt").innerHTML = "Fullscreen";
|
||||
}
|
||||
}
|
||||
|
||||
function isFullscreen() {
|
||||
return (document.fullscreenElement || // alternative standard method
|
||||
document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement ) // current working methods
|
||||
}
|
||||
|
||||
function switchContent(divid, uri) {
|
||||
var hash = divid;
|
||||
if (uri) {
|
||||
@ -506,7 +509,16 @@ $(document).ready(function(event) {
|
||||
toggleFullscreen();
|
||||
});
|
||||
|
||||
// remove buttons only for MusicBox
|
||||
// event handlers for full screen mode
|
||||
$(document).on('webkitfullscreenchange mozfullscreenchange fullscreenchange, MSFullscreenChange', function(e) {
|
||||
if (isFullscreen()) {
|
||||
document.getElementById("toggletxt").innerHTML = "Exit Fullscreen";
|
||||
} else {
|
||||
document.getElementById("toggletxt").innerHTML = "Fullscreen";
|
||||
}
|
||||
});
|
||||
|
||||
// remove buttons only for MusicBox
|
||||
if (!isMusicBox) {
|
||||
$('#navSettings').hide();
|
||||
$('#navshutdown').hide();
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
CACHE MANIFEST
|
||||
|
||||
# 2016-02-15:v1
|
||||
# 2016-02-18:v1
|
||||
|
||||
NETWORK:
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user