forked from platypush/platypush
[Media UI] MediaImage
should emit both play
and select
.
This commit is contained in:
parent
75aed6af92
commit
c416d0ea1f
3 changed files with 15 additions and 4 deletions
|
@ -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">
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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':
|
||||
|
|
Loading…
Reference in a new issue