diff options
author | Thomas Citharel <tcit@tcit.fr> | 2015-03-07 23:59:27 +0100 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2015-03-07 23:59:27 +0100 |
commit | c34a8956e1cd07498457f3211898e8de6d794de3 (patch) | |
tree | b53b0e16f39657af447294bb4b96a2d4f4cc22b1 /themes/default | |
parent | 00dc7622fbb25458f82b8d81dffae6f843dadece (diff) | |
download | wallabag-c34a8956e1cd07498457f3211898e8de6d794de3.tar.gz wallabag-c34a8956e1cd07498457f3211898e8de6d794de3.tar.zst wallabag-c34a8956e1cd07498457f3211898e8de6d794de3.zip |
implement swipe gestures on mobile to go to next and previous articles
Diffstat (limited to 'themes/default')
-rwxr-xr-x | themes/default/_head.twig | 1 | ||||
-rwxr-xr-x | themes/default/view.twig | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/themes/default/_head.twig b/themes/default/_head.twig index f3c9d886..ce1bbdcc 100755 --- a/themes/default/_head.twig +++ b/themes/default/_head.twig | |||
@@ -30,6 +30,7 @@ | |||
30 | <link rel="stylesheet" href="{{ poche_url }}themes/default/css/messages.css" media="all"> | 30 | <link rel="stylesheet" href="{{ poche_url }}themes/default/css/messages.css" media="all"> |
31 | <link rel="stylesheet" href="{{ poche_url }}themes/default/css/print.css" media="print"> | 31 | <link rel="stylesheet" href="{{ poche_url }}themes/default/css/print.css" media="print"> |
32 | <script src="{{ poche_url }}themes/_global/js/jquery-2.1.3.min.js"></script> | 32 | <script src="{{ poche_url }}themes/_global/js/jquery-2.1.3.min.js"></script> |
33 | <script src="{{ poche_url }}themes/_global/js/jquery.mobile.events.touch.min.js"></script> | ||
33 | <script src="{{ poche_url }}themes/_global/js/autoClose.js"></script> | 34 | <script src="{{ poche_url }}themes/_global/js/autoClose.js"></script> |
34 | <script src="{{ poche_url }}themes/default/js/closeMessage.js"></script> | 35 | <script src="{{ poche_url }}themes/default/js/closeMessage.js"></script> |
35 | <script src="{{ poche_url }}themes/_global/js/saveLink.js"></script> | 36 | <script src="{{ poche_url }}themes/_global/js/saveLink.js"></script> |
diff --git a/themes/default/view.twig b/themes/default/view.twig index 9c9d1561..57d25965 100755 --- a/themes/default/view.twig +++ b/themes/default/view.twig | |||
@@ -125,6 +125,17 @@ | |||
125 | $('#article_toolbar .tool.top').parent().hide(); | 125 | $('#article_toolbar .tool.top').parent().hide(); |
126 | } | 126 | } |
127 | }); | 127 | }); |
128 | |||
129 | // Use left and right arrow to navigate on with keyboard | ||
128 | navigateKeyboard('?view=view&id={{ navigate.nextid|e }}','?view=view&id={{ navigate.previousid|e }}'); | 130 | navigateKeyboard('?view=view&id={{ navigate.nextid|e }}','?view=view&id={{ navigate.previousid|e }}'); |
131 | |||
132 | // swipe to right or left on mobile to navigate | ||
133 | $('article').on("swiperight", function(){ | ||
134 | goLeft('?view=view&id={{ navigate.nextid|e }}'); | ||
135 | }); | ||
136 | $('article').on("swipeleft", function(){ | ||
137 | goRight('?view=view&id={{ navigate.previousid|e }}'); | ||
138 | }); | ||
139 | |||
129 | </script> | 140 | </script> |
130 | {% endblock %} | 141 | {% endblock %} |