summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--baitv.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/baitv.js b/baitv.js
index 93308af..91078fe 100644
--- a/baitv.js
+++ b/baitv.js
@@ -403,16 +403,17 @@ function on_hidecomments() {
}
}
+function fullscreenElement() {
+ return (document.fullscreenElement ||
+ document.webkitFullscreenElement ||
+ document.mozFullScreenElement ||
+ document.msFullscreenElement);
+}
+
function on_fullscreen() {
- var elem = document.getElementById("player");
-
- if (
- document.fullscreenElement || /* Standard syntax */
- document.webkitFullscreenElement || /* Chrome, Safari and Opera syntax */
- document.mozFullScreenElement ||/* Firefox syntax */
- document.msFullscreenElement /* IE/Edge syntax */
- ) {
- console.log("requesting exit full screen");
+ var elem = document.getElementById("player");
+
+ if (fullscreenElement()) {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.mozCancelFullScreen) { /* Firefox */
@@ -459,11 +460,10 @@ function fullscreen_move(e) {
}
function fullscreen_event() {
- console.log("fullscreen event");
var noticebox = document.getElementById("noticebox");
var base = document.getElementById("base");
- if(document.fullscreenElement) {
+ if(fullscreenElement()) {
base.style.position = "absolute";
base.style.opacity = "0.7";
noticebox.style.position = "absolute";