fixes layout

This commit is contained in:
buttle 2021-06-27 16:15:17 +02:00
parent 74a0c3e8ca
commit 569b21ad1d
2 changed files with 45 additions and 53 deletions

View File

@ -94,12 +94,13 @@ class PanoramaViewer extends AbstractBlockLayout
}
}
$item_id = $attachments[0]->item()->url();
$title = $attachments[0]->item()->title();
//$title = $attachments[0]->item()->title();
$title = $block->dataValue('title');
$width = $block->dataValue('width');
$height = $width / $block->dataValue('ratio');
return $view->partial('common/block-layout/panorama-viewer', [
'panorama_type' => $panorama_type,
'title' => $block->dataValue('title'),
'title' => $title,
'width' => $width,
'height' => $height,
'autoLoad' => $block->dataValue('autoLoad'),
@ -109,7 +110,6 @@ class PanoramaViewer extends AbstractBlockLayout
'mediaTypes' => $media_types,
'thumbnails' => $thumbnails,
'item_url' => $attachments[0]->item()->url(),
'item_title' => $attachments[0]->item()->title(),
]);
}
}

View File

@ -1,5 +1,3 @@
<div class="pannemmul-wrap" style="position:relative;">
<?php
$this->headLink()->appendStylesheet($this->assetUrl('vendor/pannellum/pannellum.css',
'PanoramaViewer'));
@ -28,13 +26,16 @@
}
</style>
<div class="archive-item pannellum-wrap">
<?php if ($panorama_type == "video") { ?>
<div class="pannemmul-wrap" style="position:relative;">
<?php if ($renderSourceLink) { ?>
<div class="source-link">
<a href="<?= $item_url ?>">Source</a>
</div>
<?php } ?>
<div class="archive-item pannellum-wrap">
<?php if ($panorama_type == "video") { ?>
<video id="<?= $id ?>"
class="video-js vjs-default-skin vjs-big-play-centered"
controls preload="none"
@ -50,13 +51,9 @@
</p>
</video>
<?php } else { ?>
<?php if ($renderSourceLink) { ?>
<div class="source-link">
<a href="<?= $item_url ?>">Source</a>
</div>
<?php } ?>
<div id="<?= $id ?>" class="panorama-viewer"></div>
<?php } ?>
<?php if ($title) { ?>
<div class="item_title">
<?= $title ?>
@ -64,8 +61,9 @@
<?php } ?>
</div>
<script>
</div>
<script>
<?php if ($panorama_type == "equirectangular") { ?>
pannellum.viewer("<?= $id ?>", {
type: "equirectangular",
@ -97,10 +95,4 @@
}
});
<?php } ?>
<?php if ($title !== false): ?>
$('#pannellum-ui').append('<?= $title ?>');
<?php endif ?>
</script>
</div>