blob: e0572aad013b1757642c2c1bcb56651da9b9e2d3 (
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
'use strict';
function enable_swipes() {
$(window).off("swipeleft swiperight");
$(window).on("swipeleft", function() {
parent.next_page();
});
$(window).on("swiperight", function() {
parent.prev_page();
});
}
$(document).ready(function() {
console.log('setting taps');
$(window).on("click tap", function() {
if (parent.$(".header").is(":visible")) {
parent.show_ui(false);
} else {
parent.show_ui(true);
}
});
$(window).on("mouseup", function(evt) {
if (evt.button == 0) {
if ($(".modal").is(":visible"))
return;
var reader = $("body");
var doc = document.documentElement;
var margin_side = parseInt(reader.css("padding-left"), 10);
if (evt.clientX >= doc.clientWidth - margin_side) {
console.log("iframe: RIGHT SIDE");
parent.next_page();
} else if (evt.clientX <= margin_side) {
console.log("iframe: LEFT SIDE");
parent.prev_page();
}
}
});
$(window).on("touchstart", function() {
enable_swipes();
});
$(window).on("mousedown", function() {
$(window).off("swipeleft swiperight");
});
enable_swipes();
});
|