toggle favorite action test

This commit is contained in:
Jonas Heinrich 2020-10-20 15:09:30 +02:00
parent 6c980e3646
commit f064943f6e
2 changed files with 7 additions and 3 deletions

View File

@ -10,7 +10,8 @@
</Breadcrumbs> </Breadcrumbs>
<Table <Table
:station-data="tableData" :station-data="tableData"
@doPlay="doPlay" /> @doPlay="doPlay"
@doFavor="doFavor" />
</AppContent> </AppContent>
</Content> </Content>
</template> </template>
@ -45,6 +46,9 @@ export default {
this.scroll() this.scroll()
}, },
methods: { methods: {
doFavor(station) {
console.log(station)
},
doPlay(station) { doPlay(station) {
if (audioPlayer !== null) { if (audioPlayer !== null) {
audioPlayer.fade(100, 0, 500) // FIXME persistent volume state audioPlayer.fade(100, 0, 500) // FIXME persistent volume state

View File

@ -14,10 +14,10 @@
v-for="(station, idx) in stationData" v-for="(station, idx) in stationData"
:key="idx" :key="idx"
:class="{ selected: idx === activeItem}"> :class="{ selected: idx === activeItem}">
<td @click="doPlay"> <td @click="doPlay(idx, station)">
<div class="stationIcon" <div class="stationIcon"
:style="{ backgroundImage: `url('${ station.favicon }')` }"> :style="{ backgroundImage: `url('${ station.favicon }')` }">
<span :class="{ 'icon-starred': idx === activeItem}" /> <span :class="{ 'icon-starred': stationsFavored.includes(idx) }" />
</div> </div>
</td> </td>
<td class="filenameColumn" @click="doPlay(idx, station)"> <td class="filenameColumn" @click="doPlay(idx, station)">