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="media-info">
|
||||||
<div class="row header">
|
<div class="row header">
|
||||||
<div class="image-container">
|
<div class="image-container">
|
||||||
<MediaImage :item="item" @play="$emit('play')" />
|
<MediaImage :item="item" @play="$emit('play')" @select="$emit('select')" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="title">
|
<div class="title">
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
@click.right.prevent="$refs.dropdown.toggle()"
|
@click.right.prevent="$refs.dropdown.toggle()"
|
||||||
v-if="!hidden">
|
v-if="!hidden">
|
||||||
<div class="thumbnail">
|
<div class="thumbnail">
|
||||||
<MediaImage :item="item" @play="$emit('play')" />
|
<MediaImage :item="item" @play="$emit('play')" @select="$emit('select')" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="body">
|
<div class="body">
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="image-container"
|
<div class="image-container"
|
||||||
:class="{ 'with-image': !!item?.image }">
|
: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" />
|
<i :class="overlayIconClass" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ import MediaUtils from "@/components/Media/Utils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [Icons, MediaUtils],
|
mixins: [Icons, MediaUtils],
|
||||||
emits: ['play'],
|
emits: ['play', 'select'],
|
||||||
props: {
|
props: {
|
||||||
item: {
|
item: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
@ -60,6 +60,17 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
clickEvent() {
|
||||||
|
switch (this.item?.item_type) {
|
||||||
|
case 'channel':
|
||||||
|
case 'playlist':
|
||||||
|
case 'folder':
|
||||||
|
return 'select'
|
||||||
|
default:
|
||||||
|
return 'play'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
iconClass() {
|
iconClass() {
|
||||||
switch (this.item?.item_type) {
|
switch (this.item?.item_type) {
|
||||||
case 'channel':
|
case 'channel':
|
||||||
|
|
Loading…
Reference in a new issue