remove jquery.hammer.min.js dependency
This commit is contained in:
@@ -1,7 +1 @@
|
||||
//= require jquery-1.10.1.min.js
|
||||
//= require hammer.min.js
|
||||
//= require jquery.hammer.min.js
|
||||
|
||||
$(function() {
|
||||
$(document).hammer();
|
||||
});
|
||||
|
||||
@@ -11,25 +11,20 @@
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$(document)
|
||||
.hammer()
|
||||
.on("swipeleft", function(e) {
|
||||
if (e.gesture.distance > 125) {
|
||||
var href = $(".paginator a[rel=next]").attr("href");
|
||||
if (href) {
|
||||
window.location = href;
|
||||
}
|
||||
}
|
||||
})
|
||||
.on("swiperight", function(e) {
|
||||
if (e.gesture.distance > 125) {
|
||||
var href = $(".paginator a[rel=prev]").attr("href");
|
||||
if (href) {
|
||||
window.location = href;
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
var doc = new Hammer(document);
|
||||
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;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -13,19 +13,16 @@
|
||||
<meta name="viewport" content="width=device-width,initial-scale=<%= @post.device_scale %>">
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$(document).on("swipeleft", function(e) {
|
||||
if (e.gesture.distance > 150) {
|
||||
var href = $(".paginator a[rel=next]").attr("href");
|
||||
if (href) {
|
||||
window.location = href;
|
||||
}
|
||||
var doc = new Hammer(document);
|
||||
doc.on("swipeleft", function(e) {
|
||||
var href = $(".paginator a[rel=next]").attr("href");
|
||||
if (href) {
|
||||
window.location = href;
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("swiperight", function(e) {
|
||||
if (e.gesture.distance > 150) {
|
||||
window.history.back();
|
||||
}
|
||||
doc.on("swiperight", function(e) {
|
||||
window.history.back();
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user