Vimeo-omeka-module/view/common/block-layout/vimeo.phtml

40 lines
790 B
PHTML
Raw Normal View History

<?php
$this->headScript()->appendFile($this->assetUrl('js/height_calculator.js',
'Vimeo'));
?>
2021-08-30 18:14:25 +02:00
<div class="archive-embeded-media-wrapper"
style="position:relative;">
2021-07-18 20:58:50 +02:00
<?php if ($renderSourceLink) { ?>
<div class="source-link">
<a href="<?= $item_url ?>">Source</a>
</div>
<?php } ?>
<?= $vimeo_iframe ?>
<?php if ($title) { ?>
<div class="item_title">
<?= $title ?>
</div>
<?php } ?>
</div>
<script>
function adjust_height() {
2021-08-30 18:14:25 +02:00
$(".archive-embeded-media-wrapper").each(function() {
var iframe = $(this).find('iframe')
var ratio = $(iframe).attr('ratio')
$(iframe).prop("height", get_height(iframe, ratio))
});
}
2021-07-18 20:58:50 +02:00
jQuery(document).ready(function() {
adjust_height();
});
$( window ).resize(function() {
adjust_height();
2021-07-18 20:58:50 +02:00
});
</script>