Ox.Fullscreen: allow passing an element to enter method, document.body remains default
This commit is contained in:
parent
b18c84a4ce
commit
56468a9208
1 changed files with 8 additions and 7 deletions
|
@ -98,13 +98,14 @@ Ox.Fullscreen = (function() {
|
||||||
bind(event, handler, true);
|
bind(event, handler, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
that.enter = function() {
|
that.enter = function(element) {
|
||||||
if (document.body.requestFullscreen) {
|
var element = element || document.body;
|
||||||
document.body.requestFullscreen();
|
if (element.requestFullscreen) {
|
||||||
} else if (document.body.mozRequestFullScreen) {
|
element.requestFullscreen();
|
||||||
document.body.mozRequestFullScreen();
|
} else if (element.mozRequestFullScreen) {
|
||||||
} else if (document.body.webkitRequestFullscreen) {
|
element.mozRequestFullScreen();
|
||||||
document.body.webkitRequestFullscreen();
|
} else if (element.webkitRequestFullscreen) {
|
||||||
|
element.webkitRequestFullscreen();
|
||||||
}
|
}
|
||||||
// FIXME: Why does storing the function in a variable not work?
|
// FIXME: Why does storing the function in a variable not work?
|
||||||
// enter && enter();
|
// enter && enter();
|
||||||
|
|
Loading…
Reference in a new issue