mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-03 07:13:59 +01:00
Function to switch screen mode
Handles future proposed spec, plus Moz & Chrome prefixes for usage now Also changes icon on switching
This commit is contained in:
21
lib/coder.js
21
lib/coder.js
@@ -1518,5 +1518,26 @@ var ICEcoder = {
|
||||
if (dContainer) {
|
||||
dContainer.innerHTML = top.ICEcoder.fileCount+" "+fileText+", "+top.ICEcoder.dirCount+" "+dirText+"<br>~ "+unitSize+" "+unitText;
|
||||
}
|
||||
},
|
||||
|
||||
// Toggle full screen on/off
|
||||
fullScreenSwitcher: function() {
|
||||
var screenIcon;
|
||||
|
||||
screenIcon = top.document.getElementById('screenMode');
|
||||
|
||||
// Future use
|
||||
if ("undefined" != typeof document.cancelFullScreen) {
|
||||
document.fullScreen ? document.cancelFullScreen() : document.body.requestFullScreen();
|
||||
// Moz specific
|
||||
} else if ("undefined" != typeof document.mozCancelFullScreen) {
|
||||
document.mozFullScreen ? document.mozCancelFullScreen() : document.body.mozRequestFullScreen();
|
||||
// Chrome specific
|
||||
} else if ("undefined" != typeof document.webkitCancelFullScreen) {
|
||||
document.webkitIsFullScreen ? document.webkitCancelFullScreen() : document.body.webkitRequestFullScreen();
|
||||
}
|
||||
|
||||
screenIcon.src.indexOf("images/full-screen.gif") > -1 ? screenIcon.src = "images/restored-screen.gif" : screenIcon.src = "images/full-screen.gif";
|
||||
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user