{% extends 'view_file_base.html' %}
{% load i18n %}

{% block extra_style %}{{ block.super }}
<style type="text/css">
#file-view {
    text-align:center;
}
</style>
{% endblock %}

{% block file_view_extra_class %}image-file-view{% endblock %}

{% block file_view %}
<span class="loading-icon"></span>
<img src="{{ raw_path }}" alt="{{ filename }}" id="svg-view" class="hide" />
{% endblock %}

{% block extra_script %}{{ block.super }}
<script type="text/javascript">
function setFileViewAreaHeight() {
    var $fileView = $('#file-view');
    $fileView.outerHeight($(window).height() - $fileView.offset().top);
}
setFileViewAreaHeight();
$(window).on('resize', setFileViewAreaHeight);
$('#svg-view').prev('.loading-icon').hide();
$('#svg-view').show();
</script>
{% endblock %}
