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 | |
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')
-rwxr-xr-x | themes/baggy/_head.twig | 1 | ||||
-rwxr-xr-x | themes/baggy/view.twig | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/themes/baggy/_head.twig b/themes/baggy/_head.twig index 3799f8fb..b9f1e5d9 100755 --- a/themes/baggy/_head.twig +++ b/themes/baggy/_head.twig | |||
@@ -31,6 +31,7 @@ | |||
31 | <link rel="stylesheet" href="{{ poche_url }}themes/{{theme}}/css/print.css" media="print"> | 31 | <link rel="stylesheet" href="{{ poche_url }}themes/{{theme}}/css/print.css" media="print"> |
32 | 32 | ||
33 | <script src="{{ poche_url }}themes/_global/js/jquery-2.1.3.min.js"></script> | 33 | <script src="{{ poche_url }}themes/_global/js/jquery-2.1.3.min.js"></script> |
34 | <script src="{{ poche_url }}themes/_global/js/jquery.mobile.events.touch.min.js"></script> | ||
34 | <script src="{{ poche_url }}themes/_global/js/autoClose.js"></script> | 35 | <script src="{{ poche_url }}themes/_global/js/autoClose.js"></script> |
35 | <script src="{{ poche_url }}themes/{{theme}}/js/jquery.cookie.js"></script> | 36 | <script src="{{ poche_url }}themes/{{theme}}/js/jquery.cookie.js"></script> |
36 | <script src="{{ poche_url }}themes/{{theme}}/js/init.js"></script> | 37 | <script src="{{ poche_url }}themes/{{theme}}/js/init.js"></script> |
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 %} |