diff options
-rw-r--r-- | js/read.js | 4 | ||||
-rw-r--r-- | read.html | 21 |
2 files changed, 23 insertions, 2 deletions
@@ -202,4 +202,6 @@ function search() { } } - +function toggle_transitions(elem) { + localforage.setItem("epube.disable-transitions", elem.checked); +} @@ -55,6 +55,18 @@ </div> </div> + <div class="form-group"> + <label class="col-sm-3 control-label"></label> + <div class="col-sm-9"> + <div class="checkbox"> + <label> + <input class="transition_checkbox" onchange="toggle_transitions(this)" + type="checkbox"> Disable transitions (needs page reload) + </label> + </div> + </div> + </div> + <hr/> <div class="form-group"> @@ -328,7 +340,10 @@ baseUrl + "lib/jquery.mobile.custom.js", baseUrl + "js/swipes.js" ], null, renderer.doc.head); - EPUBJS.core.addCss(baseUrl + "css/transitions.css", null, renderer.doc.head); + localforage.getItem("epube.disable-transitions").then(function(disable) { + if (!disable) + EPUBJS.core.addCss(baseUrl + "css/transitions.css", null, renderer.doc.head); + }); if (callback) callback(); } @@ -370,6 +385,10 @@ $(".lastread_input").val(data.page); }); + localforage.getItem("epube.disable-transitions").then(function(disable) { + $(".transition_checkbox").attr("checked", disable); + }); + localforage.getItem("epube.fontFamily").then(function(font) { if (!font) font = DEFAULT_FONT_FAMILY; |