blob: 89c3de157f9796dce76cbec722bbbd8b6a9d900a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
'use strict';
function enable_swipes() {
$(window).off("swipeleft swiperight");
$(window).on("swipeleft", function() {
parent.show_ui(false);
parent.request_fullscreen();
parent.book.rendition.next();
});
$(window).on("swiperight", function() {
parent.show_ui(false);
parent.request_fullscreen();
parent.book.rendition.prev();
});
}
$(document).ready(function() {
console.log('setting taps');
$(window).on("click tap", function() {
if (parent.$(".header").is(":visible")) {
parent.show_ui(false);
parent.request_fullscreen();
} else {
parent.show_ui(true);
parent.disable_fullscreen();
}
});
$(window).on("touchstart", function() {
enable_swipes();
});
$(window).on("mousedown", function() {
$(window).off("swipeleft swiperight");
});
enable_swipes();
});
|