Galerie: přepínání fotek klávesnicí
This commit is contained in:
parent
daf6af4315
commit
03c8c1c8dd
2 changed files with 32 additions and 0 deletions
|
@ -1,10 +1,39 @@
|
|||
{% extends "galerie/Base.html" %}
|
||||
|
||||
|
||||
{% block nadpis1a %}
|
||||
{{galerie.nazev}}: {{ obrazek.popis | default:"Fotka" }}
|
||||
{% endblock %}
|
||||
|
||||
{% block script %}
|
||||
{% with obrazky_predchozi|last as predchozi_obrazek %}
|
||||
{% with obrazky_dalsi|first as dalsi_obrazek %}
|
||||
<script type="text/javascript">
|
||||
$(document).keydown(function(e) {
|
||||
{% if predchozi_obrazek %}
|
||||
// doleva
|
||||
if (e.which == 37) {
|
||||
window.location.assign("../{{ predchozi_obrazek.pk }}#nahoru");
|
||||
}
|
||||
{% endif %}
|
||||
{% if dalsi_obrazek %}
|
||||
// doprava
|
||||
if (e.which == 39) {
|
||||
window.location.assign("../{{ dalsi_obrazek.pk }}#nahoru");
|
||||
}
|
||||
{% endif %}
|
||||
if (e.which == 27) {
|
||||
window.location.assign("../#obsah")
|
||||
}
|
||||
})
|
||||
</script>
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
|
||||
<h2>
|
||||
{% for g in cesta %}
|
||||
<a href="../../{{ g.pk }}">{{ g.nazev }}</a> >
|
||||
|
|
|
@ -29,6 +29,9 @@
|
|||
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
|
||||
{# script specifický pro stránku #}
|
||||
{% block script %}{% endblock %}
|
||||
|
||||
</head>
|
||||
<body class='{% if user.is_staff %}org-logged-in{% endif %}'>
|
||||
{% if user.is_staff %}
|
||||
|
|
Loading…
Reference in a new issue