From f0deb0736294d72c5edc38d2569c59eb2cac67ab Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 25 Jan 2018 18:52:21 +0300 Subject: fullscreen (not working) --- js/read.js | 16 ++++++++++++++++ read.html | 14 ++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/js/read.js b/js/read.js index f56df46..e6ad650 100644 --- a/js/read.js +++ b/js/read.js @@ -1,5 +1,19 @@ var _store_position = 0; +function request_fullscreen() { + localforage.getItem("epube.enable-fullscreen").then(function(enable) { + + if (enable) { + var elem = document.documentElement; + var func = elem.webkitRequestFullscreen; + + if (typeof func != "undefined") { + func.call(elem); + } + } + }); +} + function show_ui(show) { if (show) $(".header,.footer").fadeIn(); @@ -18,11 +32,13 @@ function next_page() { _store_position = 1; window.book.nextPage(); + show_ui(false); } function prev_page() { window.book.prevPage(); + show_ui(false); } diff --git a/read.html b/read.html index 0c09b88..2a0b437 100644 --- a/read.html +++ b/read.html @@ -75,6 +75,12 @@ type="checkbox"> Disable swipes +
+ +
@@ -447,6 +453,14 @@ }); }); + localforage.getItem("epube.enable-fullscreen").then(function(enable) { + $(".fullscreen_checkbox") + .attr("checked", enable) + .on("click", function() { + localforage.setItem("epube.enable-fullscreen", this.checked); + }); + }); + localforage.getItem("epube.fontFamily").then(function(font) { if (!font) font = DEFAULT_FONT_FAMILY; -- cgit v1.2.3