[Media UI] MediaImage should emit both play and select.

This commit is contained in:
Fabio Manganiello 2024-07-15 22:28:06 +02:00
parent 75aed6af92
commit c416d0ea1f
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774
3 changed files with 15 additions and 4 deletions

View file

@ -2,7 +2,7 @@
<div class="media-info">
<div class="row header">
<div class="image-container">
<MediaImage :item="item" @play="$emit('play')" />
<MediaImage :item="item" @play="$emit('play')" @select="$emit('select')" />
</div>
<div class="title">

View file

@ -5,7 +5,7 @@
@click.right.prevent="$refs.dropdown.toggle()"
v-if="!hidden">
<div class="thumbnail">
<MediaImage :item="item" @play="$emit('play')" />
<MediaImage :item="item" @play="$emit('play')" @select="$emit('select')" />
</div>
<div class="body">

View file

@ -1,7 +1,7 @@
<template>
<div class="image-container"
:class="{ 'with-image': !!item?.image }">
<div class="play-overlay" @click="$emit('play', item)" v-if="hasPlay">
<div class="play-overlay" @click="$emit(clickEvent, item)" v-if="hasPlay">
<i :class="overlayIconClass" />
</div>
@ -40,7 +40,7 @@ import MediaUtils from "@/components/Media/Utils";
export default {
mixins: [Icons, MediaUtils],
emits: ['play'],
emits: ['play', 'select'],
props: {
item: {
type: Object,
@ -60,6 +60,17 @@ export default {
},
computed: {
clickEvent() {
switch (this.item?.item_type) {
case 'channel':
case 'playlist':
case 'folder':
return 'select'
default:
return 'play'
}
},
iconClass() {
switch (this.item?.item_type) {
case 'channel':