summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-07-02 14:11:52 +0300
committerAndrew Dolgov <[email protected]>2018-07-02 14:11:52 +0300
commit0ce9f005423032539af41b280c3422507408edfd (patch)
tree492c0f11f195b1546c3b1083965d60137e05b087 /js
parent7b462f0b3ce566ac7edba96507ca951371705776 (diff)
use jquery wheel event handler
Diffstat (limited to 'js')
-rw-r--r--js/reader.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/js/reader.js b/js/reader.js
index d7eddbe..d3614aa 100644
--- a/js/reader.js
+++ b/js/reader.js
@@ -13,7 +13,7 @@ function enable_swipes() {
}
$(document).ready(function() {
- $(window).on("mouseup", function(evt) {
+ $(window).on("click tap", function(evt) {
if (evt.button == 0) {
if ($(".modal").is(":visible"))
@@ -35,6 +35,14 @@ $(document).ready(function() {
$(window).off("swipeleft swiperight");
});
+ $(window).on("wheel", function(evt) {
+ if (evt.originalEvent.deltaY > 0) {
+ parent.next_page();
+ } else if (evt.originalEvent.deltaY < 0) {
+ parent.prev_page();
+ }
+ });
+
enable_swipes();
});