misc: try to follow window resizes to alter pdfjs iframe height

This commit is contained in:
Frédéric Péters 2015-11-02 18:35:17 +01:00
parent a7c65b8224
commit acb9173a94
1 changed files with 9 additions and 1 deletions

View File

@ -27,7 +27,15 @@ $('div.cell h2').on('click', function() {
$('div.cell').removeClass('top');
$(this).parents('div.cell').addClass('top');
});
$('iframe').css('height', 'calc( ' + $('.document').height() + 'px - 7em)');
$(window).on('resize', function() {
if ($('.top iframe').length == 1) {
$('.top iframe').css('height', 'calc( ' + $('.document').height() + 'px - 7em)');
} else {
$('iframe').css('height', 'calc( ' + $('.document').height() + 'px - 2em)');
}
});
$(window).trigger('resize');
</script>
{% endblock %}