show full media on upload / add a switch to show preview, fix #257

This commit is contained in:
lesion 2023-05-06 18:49:57 +02:00
parent 43e498acc5
commit 018adf1c0d
No known key found for this signature in database
GPG key ID: 352918250B012177

View file

@ -32,10 +32,12 @@ span
h3.mb-3.font-weight-regular(v-if='mediaPreview') {{$t('common.media')}} h3.mb-3.font-weight-regular(v-if='mediaPreview') {{$t('common.media')}}
v-card-actions(v-if='mediaPreview') v-card-actions(v-if='mediaPreview')
v-spacer v-spacer
v-switch(v-model='showPreview' inset :label="$t('common.show_preview')")
v-btn(text color='primary' @click='openMediaDetails = true') {{$t('common.edit')}} v-btn(text color='primary' @click='openMediaDetails = true') {{$t('common.edit')}}
v-btn(text color='error' @click='remove') {{$t('common.remove')}} v-btn(text color='error' @click='remove') {{$t('common.remove')}}
div(v-if='mediaPreview') div(v-if='mediaPreview')
img.mediaPreview.col-12.ml-3(:src='mediaPreview' :style="{ 'object-position': savedPosition }") img.col-12.ml-3(:src='mediaPreview' v-if='showPreview')
img.mediaPreview.col-12.ml-3(:src='mediaPreview' v-else :style="{ 'object-position': savedPosition }")
span.float-right {{event.media[0].name}} span.float-right {{event.media[0].name}}
v-file-input( v-file-input(
v-else v-else
@ -58,6 +60,7 @@ export default {
data () { data () {
return { return {
mdiCamera, mdiCamera,
showPreview: true,
openMediaDetails: false, openMediaDetails: false,
name: this.value.name || '', name: this.value.name || '',
focalpoint: this.value.focalpoint || [0, 0], focalpoint: this.value.focalpoint || [0, 0],