diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/reader.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/js/reader.js b/js/reader.js index 34c5e06..26705d6 100644 --- a/js/reader.js +++ b/js/reader.js @@ -1,5 +1,17 @@ 'use strict'; +function enable_swipes() { + $(window).off("swipeleft swiperight"); + + $(window).on("swipeleft", function() { + parent.book.nextPage(); + }); + + $(window).on("swiperight", function() { + parent.book.prevPage(); + }); +} + $(document).ready(function() { $(window).on("click tap", function() { if (parent.$(".header").is(":visible")) { @@ -10,5 +22,15 @@ $(document).ready(function() { parent.disable_fullscreen(); } }); + + $(window).on("touchstart", function() { + enable_swipes(); + }); + + $(window).on("mousedown", function() { + $(window).off("swipeleft swiperight"); + }); + + enable_swipes(); }); |