Add click and drag to hotspots during edit

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
2024-10-28 19:37:37 -07:00
parent 6905e1310f
commit 46ee8b6ee9
3 changed files with 88 additions and 8 deletions

View File

@@ -49,6 +49,9 @@ class GlModelTransformOutput extends MediaTransformOutput {
if (isset($options['img-class'])) {
$this->parameters['class'] = $options['img-class'];
}
if (isset($options['preview']) && $options['preview']) {
$this->parameters['preview'] = $options['preview'];
}
return self::buildViewer($this->file->getDescriptionText(),$this->url,$this->parameters);
}
@@ -89,10 +92,13 @@ class GlModelTransformOutput extends MediaTransformOutput {
$hsDefault = array(
'class' => 'Hotspot',
'slot' => 'hotspot-'.(count($hotspots) +1),
'onmousedown' => 'event.stopPropagation()',
'ontouchstart' => 'event.stopPropagation()',
'onclick' => 'onAnnotation(event)'
);
if (isset($viewParams['preview'])) {
$hsDefault['onmousedown'] = 'grabAnnotation(event)';
$hsDefault['onmouseup'] = 'releaseAnnotation(event)';
}
$attrHotspot = array_merge($hsDefault, $an);
$elHotspot = Html::rawElement('button',$attrHotspot,$elAnnot.(count($hotspots) +1));
array_push($hotspots, $elHotspot);