diff options
author | Andrew Dolgov <[email protected]> | 2018-02-20 20:15:08 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2018-02-20 20:20:36 +0300 |
commit | 77a76bda3779b25b852dcefb8c8277b23c4e469a (patch) | |
tree | 6e19b61a381f2294b4c973695972b1a4e46e3fbd /read.html | |
parent | b2a1b230132100adf754f53ca900c3574c804cdb (diff) |
disable swipes (unreliable, sometimes cause huge delays on epub chapter
unload)
Diffstat (limited to 'read.html')
-rw-r--r-- | read.html | 38 |
1 files changed, 8 insertions, 30 deletions
@@ -86,12 +86,6 @@ </div> <div class="checkbox"> <label> - <input class="swipe_checkbox" - type="checkbox"> Disable swipes - </label> - </div> - <div class="checkbox"> - <label> <input class="fullscreen_checkbox" type="checkbox"> Request fullscreen mode </label> @@ -393,32 +387,24 @@ }); } - EPUBJS.Hooks.register("beforeChapterDisplay").swipeDetection = function(callback, renderer) { + EPUBJS.Hooks.register("beforeChapterDisplay").initDict = function(callback, renderer) { var baseUrl = window.location.href.match(/^.*\//)[0]; EPUBJS.core.addScripts([baseUrl + "lib/bootstrap/v3/js/jquery.js", - baseUrl + "lib/jquery.touchSwipe.min.js", + baseUrl + "js/reader.js", baseUrl + "js/dict.js" ], null, renderer.doc.head); EPUBJS.core.addCss(baseUrl + "css/reader.css", null, renderer.doc.head); - localforage.getItem("epube.disable-swipes").then(function(noswipes) { + localforage.getItem("epube.disable-transitions").then(function(notransitions) { + if (!notransitions) { + EPUBJS.core.addCss(baseUrl + "css/transitions.css", null, renderer.doc.head); - if (!noswipes) { - EPUBJS.core.addScripts([baseUrl + "js/swipes.js" ], null, renderer.doc.head); - } - - localforage.getItem("epube.disable-transitions").then(function(notransitions) { - if (!notransitions) { - EPUBJS.core.addCss(baseUrl + "css/transitions.css", null, renderer.doc.head); - - EPUBJS.Render.Iframe.prototype.setLeft = function(leftPos){ - this.docEl.style[this.transform] = 'translate('+ (-leftPos) + 'px, 0)'; - } + EPUBJS.Render.Iframe.prototype.setLeft = function(leftPos){ + this.docEl.style[this.transform] = 'translate('+ (-leftPos) + 'px, 0)'; } - }); - + } }); if (callback) callback(); @@ -485,14 +471,6 @@ }); }); - localforage.getItem("epube.disable-swipes").then(function(disable) { - $(".swipe_checkbox") - .attr("checked", disable) - .on("click", function() { - localforage.setItem("epube.disable-swipes", this.checked); - }); - }); - localforage.getItem("epube.enable-fullscreen").then(function(enable) { $(".fullscreen_checkbox") .attr("checked", enable) |