improve swiping logic
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<%= form_tag(m_posts_path, :method => "get") do %>
|
<%= form_tag(m_posts_path, :method => "get") do %>
|
||||||
<%= text_field_tag("tags", params[:tags], :size => 17) %>
|
<%= text_field_tag("tags", params[:tags], :size => 14) %>
|
||||||
<%= submit_tag "Go", :name => nil %>
|
<%= submit_tag "Go", :name => nil %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
$(document).on("swipeleft", function(e) {
|
$(document).on("swipeleft", function(e) {
|
||||||
if (e.gesture.distance > 240) {
|
if (e.gesture.distance > 150) {
|
||||||
var href = $(".paginator a[rel=next]").attr("href");
|
var href = $(".paginator a[rel=next]").attr("href");
|
||||||
if (href) {
|
if (href) {
|
||||||
window.location = href;
|
window.location = href;
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("swiperight", function(e) {
|
$(document).on("swiperight", function(e) {
|
||||||
if (e.gesture.distance > 240) {
|
if (e.gesture.distance > 150) {
|
||||||
var href = $(".paginator a[rel=prev]").attr("href");
|
var href = $(".paginator a[rel=prev]").attr("href");
|
||||||
if (href) {
|
if (href) {
|
||||||
window.location = href;
|
window.location = href;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
$(document).on("swipeleft", function(e) {
|
$(document).on("swipeleft", function(e) {
|
||||||
if (e.gesture.distance > 240) {
|
if (e.gesture.distance > 150) {
|
||||||
var href = $(".paginator a[rel=next]").attr("href");
|
var href = $(".paginator a[rel=next]").attr("href");
|
||||||
if (href) {
|
if (href) {
|
||||||
window.location = href;
|
window.location = href;
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("swiperight", function(e) {
|
$(document).on("swiperight", function(e) {
|
||||||
if (e.gesture.distance > 240) {
|
if (e.gesture.distance > 150) {
|
||||||
window.history.back();
|
window.history.back();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user