Fix button and img visibility before model
Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
@@ -100,7 +100,8 @@ class GlModelTransformOutput extends MediaTransformOutput {
|
||||
foreach($annotations as $label => $an) {
|
||||
$elAnnot = Html::rawElement('div',['class' => 'HotspotAnnotation HiddenAnnotation'],$label);
|
||||
$hsDefault = array(
|
||||
'class' => 'Hotspot',
|
||||
'class' => 'Hotspot awaiting-model',
|
||||
'style' => 'display: none;',
|
||||
'slot' => 'hotspot-'.(count($hotspots) +1),
|
||||
'ontouchstart' => 'event.stopPropagation()',
|
||||
'onclick' => 'onAnnotation(event)'
|
||||
@@ -125,6 +126,7 @@ class GlModelTransformOutput extends MediaTransformOutput {
|
||||
//Add important additional attributes and render model-viewer with hotspots
|
||||
$attrModelView = array_merge(['src' => $srcUrl, 'class' => 'mv-model', 'interpolation-decay' => '100', 'interaction-prompt' => 'none'], $attrModelView);
|
||||
$attrModelView['style'] = 'width: 100%; height: 100%;';
|
||||
$attrModelView['onload'] = 'modelLoaded()';
|
||||
$hotspotHtml = (isset($hotspots)) ? implode($hotspots) : '';
|
||||
|
||||
$elModel = Html::rawElement('model-viewer', $attrModelView, $hotspotHtml);
|
||||
@@ -148,7 +150,8 @@ class GlModelTransformOutput extends MediaTransformOutput {
|
||||
*/
|
||||
private static function buildViewMenu() {
|
||||
$attrMenu = array(
|
||||
'class' => 'glmv-menu'
|
||||
'class' => 'glmv-menu awaiting-model',
|
||||
'style' => 'display: none;'
|
||||
);
|
||||
$mainConfig = ConfigFactory::getDefaultInstance()->makeConfig( 'main' );
|
||||
$menuUrl = $mainConfig->get( 'ExtensionAssetsPath' ) . '/GlModelViewer/resources/menu_arrow.svg';
|
||||
@@ -188,10 +191,10 @@ class GlModelTransformOutput extends MediaTransformOutput {
|
||||
'ontouchstart' => 'event.stopPropagation()'
|
||||
);
|
||||
$menuButtons = array(
|
||||
Html::rawElement('div', $attrMenuButtonPrev, '<img src="' . $gotoUrl . '"></image>'),
|
||||
Html::rawElement('div', $attrMenuButtonSlides, '<img src="' . $slideUrl . '"></image>'),
|
||||
Html::rawElement('div', $attrMenuButtonNext, '<img src="' . $gotoUrl . '"></image>'),
|
||||
Html::rawElement('div', $attrMenuButtonHide, '<img src="' . $hideUrl . '"></image>')
|
||||
Html::rawElement('div', $attrMenuButtonPrev, '<img class="awaiting-model" src="' . $gotoUrl . '"></image>'),
|
||||
Html::rawElement('div', $attrMenuButtonSlides, '<img class="awaiting-model" src="' . $slideUrl . '"></image>'),
|
||||
Html::rawElement('div', $attrMenuButtonNext, '<img class="awaiting-model" src="' . $gotoUrl . '"></image>'),
|
||||
Html::rawElement('div', $attrMenuButtonHide, '<img class="awaiting-model" src="' . $hideUrl . '"></image>')
|
||||
);
|
||||
|
||||
return Html::rawElement('div', $attrMenu, $menuImg . implode($menuButtons));
|
||||
|
||||
Reference in New Issue
Block a user