toggle favorite icon

This commit is contained in:
Jonas Heinrich 2020-10-20 15:03:20 +02:00
parent 86fd0eb3a3
commit 6c980e3646
2 changed files with 19 additions and 4 deletions

View File

@ -79,6 +79,12 @@ export default {
vm.offset += 20 vm.offset += 20
}) })
}, },
watch: {
$route(to, from) {
console.log(to)
console.log(from)
},
},
scroll() { scroll() {
window.onscroll = () => { window.onscroll = () => {
if ((window.innerHeight + window.scrollY) >= document.body.scrollHeight) { if ((window.innerHeight + window.scrollY) >= document.body.scrollHeight) {

View File

@ -17,7 +17,7 @@
<td @click="doPlay"> <td @click="doPlay">
<div class="stationIcon" <div class="stationIcon"
:style="{ backgroundImage: `url('${ station.favicon }')` }"> :style="{ backgroundImage: `url('${ station.favicon }')` }">
<span class="icon-starred" /> <span :class="{ 'icon-starred': idx === activeItem}" />
</div> </div>
</td> </td>
<td class="filenameColumn" @click="doPlay(idx, station)"> <td class="filenameColumn" @click="doPlay(idx, station)">
@ -59,6 +59,7 @@ export default {
data() { data() {
return { return {
activeItem: null, activeItem: null,
stationsFavored: [1, 2],
} }
}, },
methods: { methods: {
@ -121,9 +122,10 @@ table {
background-color: var(--color-background-hover); background-color: var(--color-background-hover);
} }
tr.selected { }
background-color: var(--color-primary-light);
} tr.selected {
background-color: var(--color-primary-light);
} }
tr td:first-child { tr td:first-child {
@ -148,6 +150,7 @@ table {
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: contain; background-size: contain;
background-position: center; background-position: center;
cursor: pointer;
} }
.icon-starred { .icon-starred {
@ -159,6 +162,12 @@ table {
background-position: center; background-position: center;
min-width: 16px; min-width: 16px;
min-height: 16px; min-height: 16px;
cursor: pointer;
pointer-events: none;
right: -7px;
top: -7px;
float: right;
position: relative;
} }
.actionColumn { .actionColumn {