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/baggy/view.twig | |
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/baggy/view.twig')
-rwxr-xr-x | themes/baggy/view.twig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/themes/baggy/view.twig b/themes/baggy/view.twig index 68af03f5..a6da85d5 100755 --- a/themes/baggy/view.twig +++ b/themes/baggy/view.twig | |||
@@ -103,6 +103,17 @@ | |||
103 | retrievePercent({{ entry.id|e }}); | 103 | retrievePercent({{ entry.id|e }}); |
104 | }); | 104 | }); |
105 | }); | 105 | }); |
106 | |||
107 | // Use left and right arrow to navigate on with keyboard | ||
106 | navigateKeyboard('?view=view&id={{ navigate.nextid|e }}','?view=view&id={{ navigate.previousid|e }}'); | 108 | navigateKeyboard('?view=view&id={{ navigate.nextid|e }}','?view=view&id={{ navigate.previousid|e }}'); |
109 | |||
110 | // swipe to right or left on mobile to navigate | ||
111 | $('article').on("swiperight", function(){ | ||
112 | goLeft('?view=view&id={{ navigate.nextid|e }}'); | ||
113 | }); | ||
114 | $('article').on("swipeleft", function(){ | ||
115 | goRight('?view=view&id={{ navigate.previousid|e }}'); | ||
116 | }); | ||
117 | |||
107 | </script> | 118 | </script> |
108 | {% endblock %} | 119 | {% endblock %} |