implement swipe gestures on mobile to go to next and previous articles

This commit is contained in:
Thomas Citharel
2015-03-07 23:59:27 +01:00
parent 00dc7622fb
commit c34a8956e1
6 changed files with 42 additions and 15 deletions

View File

@ -125,6 +125,17 @@
$('#article_toolbar .tool.top').parent().hide();
}
});
// Use left and right arrow to navigate on with keyboard
navigateKeyboard('?view=view&id={{ navigate.nextid|e }}','?view=view&id={{ navigate.previousid|e }}');
// swipe to right or left on mobile to navigate
$('article').on("swiperight", function(){
goLeft('?view=view&id={{ navigate.nextid|e }}');
});
$('article').on("swipeleft", function(){
goRight('?view=view&id={{ navigate.previousid|e }}');
});
</script>
{% endblock %}