Compare commits

..

No commits in common. "d0674ff108da00615e93804230e7c680887438ad" and "e35f30afa44e57a01b3bd60af506e763092e9752" have entirely different histories.

4 changed files with 12 additions and 20 deletions

View File

@ -1,6 +0,0 @@
function get_height(container, ratio) {
//console.log($(container).width(), ratio)
var height = $(container).width() / ratio
//console.log(height)
return height
}

View File

@ -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]',

View File

@ -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,

View File

@ -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>