Merge pull request #272 from alex-phillips/feature/links

Added navigation links
This commit is contained in:
Phan An 2016-03-20 20:40:19 +08:00
commit 87a938329a

View file

@ -5,8 +5,8 @@
:class="{ selected: selected, playing: song.playbackState === 'playing' || song.playbackState === 'paused' }" :class="{ selected: selected, playing: song.playbackState === 'playing' || song.playbackState === 'paused' }"
> >
<td class="title">{{ song.title }}</td> <td class="title">{{ song.title }}</td>
<td class="artist">{{ song.album.artist.name }}</td> <td class="artist"><a @click.prevent="viewArtistDetails">{{ song.album.artist.name }}</a></td>
<td class="album">{{ song.album.name }}</td> <td class="album"><a @click.prevent="viewAlbumDetails">{{ song.album.name }}</a></td>
<td class="time">{{ song.fmtLength }}</td> <td class="time">{{ song.fmtLength }}</td>
<td class="play" @click.stop="doPlayback"> <td class="play" @click.stop="doPlayback">
<i class="fa fa-pause-circle" v-show="song.playbackState === 'playing'"></i> <i class="fa fa-pause-circle" v-show="song.playbackState === 'playing'"></i>
@ -77,6 +77,20 @@
deselect() { deselect() {
this.selected = false; this.selected = false;
}, },
/**
* Load the album details screen.
*/
viewAlbumDetails() {
this.$root.loadAlbum(this.song.album);
},
/**
* Load the artist details screen.
*/
viewArtistDetails() {
this.$root.loadArtist(this.song.album.artist);
},
}, },
}; };
</script> </script>