<!-- Navigator -->
<script>
    $(document).keydown(function(event){
        if (event.which=="37" && event.altKey) goto_prev()
        if (event.which=="39" && event.altKey) goto_next()
        if (event.key === "Escape")
            go_back('{{ back }}');
    });
    function goto_prev() {
        {% if prev_id %}
        open_item('{% url space prev_id %}', '{{ prev_page }}')
        {% endif %}
    }
    function goto_next() {
        {% if next_id %}
        open_item('{% url space next_id %}', '{{ next_page }}')
        {% endif %}
    }
</script>
{% if navigate %}
<div style="white-space: nowrap; padding: 5px;">
    <button class="btn btn-default btn-xs {% if not prev_id %}disabled{% endif %}"
        data-toggle="tooltip" data-placement="bottom" title="Fiche précédente (Alt + &#x2190)"
        onclick="goto_prev();">
        <i class="fa fa-caret-left smallicon" aria-hidden="true"></i>
    </button>
    <button class="btn btn-default btn-xs {% if not next_id %}disabled{% endif %}"
        data-toggle="tooltip" data-placement="bottom" title="Fiche suivante (Alt + &#x2192)"
        onclick="goto_next();">
        <i class="fa fa-caret-right smallicon" aria-hidden="true"></i>
    </button>
</div>
{% endif %}
