fix Ox.Fullscreen

This commit is contained in:
rolux 2013-02-10 20:50:28 +05:30
parent 32a10a7d69
commit 4c45d71f5b
2 changed files with 15 additions and 22 deletions

View file

@ -1,13 +1,3 @@
html:fullscreen {
background-color: $bodyBackground;
}
html:-moz-full-screen {
background-color: $bodyBackground;
}
html:-webkit-full-screen {
background-color: $bodyBackground;
}
body.$themeClass {
background-color: $bodyBackground;
}

View file

@ -21,10 +21,10 @@ Ox.Fullscreen <o> Fullscreen controller
Ox.Fullscreen = (function() {
var documentElement = document.documentElement,
enter = document.documentElement.requestFullscreen
|| document.documentElement.mozRequestFullScreen
|| document.documentElement.webkitRequestFullscreen,
var documentElement = document.body,
enter = document.body.requestFullscreen
|| document.body.mozRequestFullScreen
|| document.body.webkitRequestFullscreen,
exit = document.exitFullscreen
|| document.mozCancelFullScreen
|| document.webkitExitFullscreen,
@ -87,7 +87,8 @@ Ox.Fullscreen = (function() {
that.available = document.fullscreenEnabled
|| document.webkitFullscreenEnabled
|| document.mozFullScreenEnabled || false;
|| document.mozFullScreenEnabled
|| false;
that.bind = function(event, handler) {
bind(event, handler);
@ -98,15 +99,16 @@ Ox.Fullscreen = (function() {
};
that.enter = function() {
if (document.documentElement.requestFullscreen) {
document.documentElement.requestFullscreen();
} else if (document.documentElement.mozRequestFullScreen) {
document.documentElement.mozRequestFullScreen();
} else if (document.documentElement.webkitRequestFullscreen) {
document.documentElement.webkitRequestFullscreen();
if (document.body.requestFullscreen) {
document.body.requestFullscreen();
} else if (document.body.mozRequestFullScreen) {
document.body.mozRequestFullScreen();
} else if (document.body.webkitRequestFullscreen) {
document.body.webkitRequestFullscreen();
}
// FIXME: Why does storing the function in a variable not work?
// enter && enter();
// ^ Missing `this` binding
};
that.exit = function() {
@ -119,6 +121,7 @@ Ox.Fullscreen = (function() {
}
// FIXME: Why does storing the function in a variable not work?
// exit && exit();
// ^ Missing `this` binding
};
that.getState = function() {