Resolve "Colorized 'play' button in front of the currently playing music"
This commit is contained in:
parent
c55a926d33
commit
2c34df6193
|
@ -0,0 +1 @@
|
||||||
|
The currently playing track is now highlighted with an orange play icon (#832)
|
|
@ -20,7 +20,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="track in tracks">
|
<tr v-for="track in tracks">
|
||||||
<td class="play-cell">
|
<td class="play-cell">
|
||||||
<play-button class="basic icon" :track="track" :discrete="true"></play-button>
|
<play-button :class="['basic', {orange: isPlaying && track.id === currentTrack.id}, 'icon']" :discrete="true" :track="track"></play-button>
|
||||||
</td>
|
</td>
|
||||||
<td class="content-cell" colspan="5">
|
<td class="content-cell" colspan="5">
|
||||||
<track-favorite-icon :track="track"></track-favorite-icon>
|
<track-favorite-icon :track="track"></track-favorite-icon>
|
||||||
|
@ -57,6 +57,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { mapGetters } from "vuex"
|
||||||
import backend from '@/audio/backend'
|
import backend from '@/audio/backend'
|
||||||
import TrackFavoriteIcon from '@/components/favorites/TrackFavoriteIcon'
|
import TrackFavoriteIcon from '@/components/favorites/TrackFavoriteIcon'
|
||||||
import PlayButton from '@/components/audio/PlayButton'
|
import PlayButton from '@/components/audio/PlayButton'
|
||||||
|
@ -64,7 +65,7 @@ import PlayButton from '@/components/audio/PlayButton'
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
album: {type: Object},
|
album: {type: Object},
|
||||||
mode: {type: String, default: 'rich'}
|
mode: {type: String, default: 'rich'},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
TrackFavoriteIcon,
|
TrackFavoriteIcon,
|
||||||
|
@ -84,6 +85,12 @@ export default {
|
||||||
}
|
}
|
||||||
return this.album.tracks.slice(0, this.initialTracks)
|
return this.album.tracks.slice(0, this.initialTracks)
|
||||||
},
|
},
|
||||||
|
...mapGetters({
|
||||||
|
currentTrack: "queue/currentTrack",
|
||||||
|
}),
|
||||||
|
isPlaying () {
|
||||||
|
return this.$store.state.player.playing
|
||||||
|
},
|
||||||
tracksWithAlbum () {
|
tracksWithAlbum () {
|
||||||
// needed to include album data (especially cover)
|
// needed to include album data (especially cover)
|
||||||
// with tracks appended in queue (#795)
|
// with tracks appended in queue (#795)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<play-button class="basic icon" :discrete="true" :is-playable="playable" :track="track"></play-button>
|
<play-button :class="['basic', {orange: isPlaying && track.id === currentTrack.id}, 'icon']" :discrete="true" :is-playable="playable" :track="track"></play-button>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<img class="ui mini image" v-if="track.album.cover.original" v-lazy="$store.getters['instance/absoluteUrl'](track.album.cover.small_square_crop)">
|
<img class="ui mini image" v-if="track.album.cover.original" v-lazy="$store.getters['instance/absoluteUrl'](track.album.cover.small_square_crop)">
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { mapGetters } from "vuex"
|
||||||
import time from '@/utils/time'
|
import time from '@/utils/time'
|
||||||
import TrackFavoriteIcon from '@/components/favorites/TrackFavoriteIcon'
|
import TrackFavoriteIcon from '@/components/favorites/TrackFavoriteIcon'
|
||||||
import TrackPlaylistIcon from '@/components/playlists/TrackPlaylistIcon'
|
import TrackPlaylistIcon from '@/components/playlists/TrackPlaylistIcon'
|
||||||
|
@ -74,13 +74,19 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapGetters({
|
||||||
|
currentTrack: "queue/currentTrack",
|
||||||
|
}),
|
||||||
|
isPlaying () {
|
||||||
|
return this.$store.state.player.playing
|
||||||
|
},
|
||||||
albumArtist () {
|
albumArtist () {
|
||||||
if (this.artist) {
|
if (this.artist) {
|
||||||
return this.artist
|
return this.artist
|
||||||
} else {
|
} else {
|
||||||
return this.track.album.artist
|
return this.track.album.artist
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue