2021-07-30 13:20:46 +02:00
|
|
|
<?php
|
|
|
|
$this->headScript()->appendFile($this->assetUrl('js/height_calculator.js',
|
|
|
|
'Vimeo'));
|
|
|
|
?>
|
|
|
|
|
2021-08-30 17:27:26 +02:00
|
|
|
<div class="vimeo-embed-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>
|
2021-08-28 15:33:08 +02:00
|
|
|
function adjust_height() {
|
|
|
|
$(".vimeo-embed-wrapper").each(function() {
|
|
|
|
var iframe = $(this).find('iframe')
|
2021-08-30 17:27:26 +02:00
|
|
|
var ratio = $(iframe).attr('ratio')
|
|
|
|
$(iframe).prop("height", get_height(iframe, ratio))
|
2021-08-28 15:33:08 +02:00
|
|
|
});
|
|
|
|
}
|
2021-07-18 20:58:50 +02:00
|
|
|
jQuery(document).ready(function() {
|
2021-08-28 15:33:08 +02:00
|
|
|
adjust_height();
|
|
|
|
});
|
|
|
|
$( window ).resize(function() {
|
|
|
|
adjust_height();
|
2021-07-18 20:58:50 +02:00
|
|
|
});
|
|
|
|
</script>
|