Sketchfab-omeka-module/view/common/block-layout/sketchfab.phtml

33 lines
721 B
PHTML
Raw Normal View History

2021-07-30 20:23:03 +02:00
<?php
$this->headScript()->appendFile($this->assetUrl('js/height_calculator.js',
'Sketchfab'));
?>
<div id="sketchfab_<?= $model_id ?>" class="sketchfab-wrap" style="position:relative;">
2021-06-22 10:19:26 +02:00
<?php if ($renderSourceLink) { ?>
<div class="source-link">
<a href="<?= $item_url ?>">Source</a>
</div>
<?php } ?>
2021-06-22 10:19:26 +02:00
2021-06-22 11:37:19 +02:00
<?= $sketchfab_iframe ?>
2021-06-22 10:19:26 +02:00
<?php if ($title) { ?>
<div class="item_title">
<?= $title ?>
</div>
<?php } ?>
2021-06-22 10:19:26 +02:00
</div>
2021-06-22 11:53:13 +02:00
<script>
jQuery(document).ready(function() {
2021-07-30 20:23:03 +02:00
var sketchfab = $("#sketchfab_<?= $model_id ?>").find('iframe');
$(sketchfab).prop("width", "<?= $width ?>%")
var height = get_height(sketchfab, <?= $ratio ?>)
$(sketchfab).prop("height", height)
2021-06-22 11:53:13 +02:00
});
</script>