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,6 +1,4 @@
<div class="pannemmul-wrap" style="position:relative;">
<?php
<?php
$this->headLink()->appendStylesheet($this->assetUrl('vendor/pannellum/pannellum.css',
'PanoramaViewer'));
$this->headScript()->appendFile($this->assetUrl('vendor/pannellum/pannellum.js',
@ -19,22 +17,25 @@
} else {
$title = false;
}
?>
?>
<style>
<style>
#<?= $id ?> {
height: <?= $height ?>px;
width: <?= $width ?>px;
}
</style>
</style>
<div class="pannemmul-wrap" style="position:relative;">
<div class="archive-item pannellum-wrap">
<?php if ($panorama_type == "video") { ?>
<?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>
</script>