Compare commits
No commits in common. "d0674ff108da00615e93804230e7c680887438ad" and "e35f30afa44e57a01b3bd60af506e763092e9752" have entirely different histories.
d0674ff108
...
e35f30afa4
|
@ -1,6 +0,0 @@
|
|||
function get_height(container, ratio) {
|
||||
//console.log($(container).width(), ratio)
|
||||
var height = $(container).width() / ratio
|
||||
//console.log(height)
|
||||
return height
|
||||
}
|
|
@ -20,19 +20,16 @@ class PanoramaViewerBlockForm extends Form
|
|||
],
|
||||
]);
|
||||
|
||||
/*
|
||||
$this->add([
|
||||
'name' => 'o:block[__blockIndex__][o:data][width]',
|
||||
'type' => Element\Number::class,
|
||||
'options' => [
|
||||
'label' => 'Width in percentage',
|
||||
'label' => 'Width in pixels',
|
||||
],
|
||||
'attributes' => [
|
||||
'min' => '50',
|
||||
'max' => '100',
|
||||
'min' => '100',
|
||||
],
|
||||
]);
|
||||
*/
|
||||
|
||||
$this->add([
|
||||
'name' => 'o:block[__blockIndex__][o:data][ratio]',
|
||||
|
|
|
@ -95,10 +95,14 @@ class PanoramaViewer extends AbstractBlockLayout
|
|||
}
|
||||
$item_id = $attachments[0]->item()->url();
|
||||
//$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'),
|
||||
'ratio' => $block->dataValue('ratio'),
|
||||
'title' => $title,
|
||||
'width' => $width,
|
||||
'height' => $height,
|
||||
'autoLoad' => $block->dataValue('autoLoad'),
|
||||
'renderSourceLink' => $block->dataValue('renderSourceLink'),
|
||||
'urls' => $urls,
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
'PanoramaViewer'));
|
||||
$this->headScript()->appendFile($this->assetUrl('vendor/pannellum/pannellum.js',
|
||||
'PanoramaViewer'));
|
||||
$this->headScript()->appendFile($this->assetUrl('js/height_calculator.js',
|
||||
'PanoramaViewer'));
|
||||
|
||||
if ($panorama_type == "video") {
|
||||
$this->headLink()->appendStylesheet($this->assetUrl('vendor/video.js/video-js.css',
|
||||
|
@ -22,8 +20,9 @@
|
|||
?>
|
||||
|
||||
<style>
|
||||
.pannemmul-wrap {
|
||||
width: 100%;
|
||||
#<?= $id ?> {
|
||||
height: <?= $height ?>px;
|
||||
width: <?= $width ?>px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
@ -96,6 +95,4 @@
|
|||
}
|
||||
});
|
||||
<?php } ?>
|
||||
var height = get_height('#<?= $id ?>', <?= $ratio ?>)
|
||||
$('#<?= $id ?>').css('height', height)
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue