mirror of
https://github.com/ajurna/cbwebreader.git
synced 2025-12-06 06:17:17 +00:00
fixed on click navigation to transition between pages.
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
<div class="reveal" id="comic_box">
|
<div class="reveal" id="comic_box">
|
||||||
<div class="slides">
|
<div class="slides">
|
||||||
{% for page in pages %}
|
{% for page in pages %}
|
||||||
<section><img data-src="{% url "get_image" nav.cur_path page.index %}" class=" w-100" onclick="Reveal.next()"></section>
|
<section><img data-src="{% url "get_image" nav.cur_path page.index %}" class=" w-100" onclick="nextPage()"></section>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -38,11 +38,7 @@
|
|||||||
$(document).keydown(function(e) {
|
$(document).keydown(function(e) {
|
||||||
switch(e.which) {
|
switch(e.which) {
|
||||||
case 37: // left
|
case 37: // left
|
||||||
if (Reveal.isFirstSlide()){
|
prevPage()
|
||||||
window.location = "{% url "read_comic" nav.prev_path %}"
|
|
||||||
} else {
|
|
||||||
Reveal.prev();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 38: // up
|
case 38: // up
|
||||||
@@ -54,11 +50,7 @@
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 39: // right
|
case 39: // right
|
||||||
if (Reveal.isLastSlide()){
|
nextPage()
|
||||||
window.location = "{% url "read_comic" nav.next_path %}"
|
|
||||||
} else {
|
|
||||||
Reveal.next()
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 40: // down
|
case 40: // down
|
||||||
@@ -89,5 +81,19 @@
|
|||||||
Reveal.prev();
|
Reveal.prev();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
function prevPage() {
|
||||||
|
if (Reveal.isFirstSlide()){
|
||||||
|
window.location = "{% url "read_comic" nav.prev_path %}"
|
||||||
|
} else {
|
||||||
|
Reveal.prev();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function nextPage() {
|
||||||
|
if (Reveal.isLastSlide()){
|
||||||
|
window.location = "{% url "read_comic" nav.next_path %}"
|
||||||
|
} else {
|
||||||
|
Reveal.next()
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user