mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
hasMedia / mediaPreview webp
This commit is contained in:
parent
ccdb501979
commit
6d03d7828c
1 changed files with 12 additions and 6 deletions
|
@ -11,12 +11,15 @@
|
|||
@mouseup='handleStop' @touchend='handleStop'
|
||||
)
|
||||
div.focalPoint(:style="{ top, left }")
|
||||
img(v-if='mediaPreview' :src='mediaPreview')
|
||||
picture(v-if='hasMedia')
|
||||
source(:srcset='mediaPreview("webp")')
|
||||
img(:src='mediaPreview("jpg")')
|
||||
|
||||
v-col.col-12.col-sm-4
|
||||
p {{$t('event.choose_focal_point')}}
|
||||
img.mediaPreview.d-none.d-sm-block(v-if='mediaPreview'
|
||||
:src='mediaPreview' :style="{ 'object-position': position }")
|
||||
picture(v-if='hasMedia')
|
||||
source(:srcset='mediaPreview("webp")')
|
||||
img.mediaPreview.d-none.d-sm-block(:src='mediaPreview("jpg")' :style="{ 'object-position': position }")
|
||||
|
||||
v-textarea.mt-4(type='text'
|
||||
label='Alternative text'
|
||||
|
@ -29,12 +32,12 @@
|
|||
v-btn(text @click='openMediaDetails=false' color='warning') Cancel
|
||||
v-btn(text color='primary' @click='save') Save
|
||||
|
||||
h3.mb-3.font-weight-regular(v-if='mediaPreview') {{$t('common.media')}}
|
||||
v-card-actions(v-if='mediaPreview')
|
||||
h3.mb-3.font-weight-regular(v-if='hasMedia') {{$t('common.media')}}
|
||||
v-card-actions(v-if='hasMedia')
|
||||
v-spacer
|
||||
v-btn(text color='primary' @click='openMediaDetails = true') {{$t('common.edit')}}
|
||||
v-btn(text color='error' @click='remove') {{$t('common.remove')}}
|
||||
div.col-12.ml-3(v-if='mediaPreview')
|
||||
div.col-12.ml-3(v-if='hasMedia')
|
||||
picture
|
||||
source(:srcset='mediaPreview("webp")')
|
||||
img.mediaPreview(:src='mediaPreview("jpg")' :style="{ 'object-position': savedPosition }")
|
||||
|
@ -67,6 +70,9 @@ export default {
|
|||
}
|
||||
},
|
||||
computed: {
|
||||
hasMedia () {
|
||||
return (this.value.url || this.value.image)
|
||||
},
|
||||
top () {
|
||||
return ((this.focalpoint[1] + 1) * 50) + '%'
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue