revert hammer js changes
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
|
||||
<%= csrf_meta_tag %>
|
||||
<%= stylesheet_link_tag "mobile", :media => "screen" %>
|
||||
<%= javascript_include_tag "mobile/mobile" %>
|
||||
<%= javascript_include_tag "mobile" %>
|
||||
<%= Danbooru.config.custom_html_header_content %>
|
||||
<%= yield :html_header %>
|
||||
</head>
|
||||
|
||||
@@ -11,20 +11,23 @@
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
var doc = new Hammer(document.body);
|
||||
|
||||
doc.on("swipeleft", function(e) {
|
||||
var href = $(".paginator a[rel=next]").attr("href");
|
||||
if (href) {
|
||||
window.location = href;
|
||||
}
|
||||
});
|
||||
doc.on("swiperight", function(e) {
|
||||
var href = $(".paginator a[rel=prev]").attr("href");
|
||||
if (href) {
|
||||
window.location = href;
|
||||
$(document).on("swipeleft", function(e) {
|
||||
if (e.gesture.distance > 150) {
|
||||
var href = $(".paginator a[rel=next]").attr("href");
|
||||
if (href) {
|
||||
window.location = href;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("swiperight", function(e) {
|
||||
if (e.gesture.distance > 150) {
|
||||
var href = $(".paginator a[rel=prev]").attr("href");
|
||||
if (href) {
|
||||
window.location = href;
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<% end %>
|
||||
|
||||
@@ -13,17 +13,19 @@
|
||||
<meta name="viewport" content="width=device-width,initial-scale=<%= @post.device_scale %>">
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
var doc = new Hammer(document.body);
|
||||
|
||||
doc.on("swipeleft", function(e) {
|
||||
var href = $(".paginator a[rel=next]").attr("href");
|
||||
if (href) {
|
||||
window.location = href;
|
||||
$(document).on("swipeleft", function(e) {
|
||||
if (e.gesture.distance > 150) {
|
||||
var href = $(".paginator a[rel=next]").attr("href");
|
||||
if (href) {
|
||||
window.location = href;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
doc.on("swiperight", function(e) {
|
||||
window.history.back();
|
||||
$(document).on("swiperight", function(e) {
|
||||
if (e.gesture.distance > 150) {
|
||||
window.history.back();
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user