Optimization and fix

This commit is contained in:
An Phan 2016-10-31 15:15:32 +07:00
parent 23049112d1
commit 91a20d8be8
No known key found for this signature in database
GPG key ID: 05536BB4BCDC02A2
4 changed files with 14 additions and 8 deletions

View file

@ -54,7 +54,7 @@ export default {
},
},
computed {
computed: {
showSummary() {
return this.mode !== 'full' && !this.showingFullWiki;
},

View file

@ -53,13 +53,13 @@
<section class="top-artists" v-show="top.artists.length">
<h1>Top Artists</h1>
<div class="wrapper" :class="'as-' + preferences.artistsViewMode">
<div class="wrapper" :class="`as-${preferences.artistsViewMode}`">
<artist-item v-for="artist in top.artists" :artist="artist"/>
<span class="item filler" v-for="n in 3"/>
</div>
</section>
<section class="top-albums" :class="'as-' + preferences.albumsViewMode" v-show="top.albums.length">
<section class="top-albums" :class="`as-${preferences.albumsViewMode}`" v-show="top.albums.length">
<h1>Top Albums</h1>
<div class="wrapper">

View file

@ -3,7 +3,7 @@
<sound-bar v-if="loading"></sound-bar>
<form v-else @submit.prevent="submit">
<header>
<img :src="inSameAlbum ? songs[0].album.cover : '/public/img/covers/unknown-album.png'" width="96" height="96">
<img :src="coverUrl" width="96" height="96">
<hgroup class="meta">
<h1 :class="{ mixed: !editSingle }">{{ displayedTitle }}</h1>
<h2 :class="{ mixed: !bySameArtist && !formData.artistName }">
@ -159,6 +159,15 @@
return every(this.songs, song => song.album.id === this.songs[0].album.id);
},
/**
* URL of the cover to display.
*
* @return {string}
*/
coverUrl() {
return this.inSameAlbum ? this.songs[0].album.cover : '/public/img/covers/unknown-album.png';
},
/**
* Determine the compilation state of the songs.
*

View file

@ -3,10 +3,7 @@
<div class="side player-controls" id="playerControls">
<i class="prev fa fa-step-backward control" @click.prevent="playPrev"/>
<span class="play control"
v-if="song.playbackState === 'stopped' || song.playbackState === 'paused'"
@click.prevent="resume"
>
<span class="play control" v-if="song.playbackState !== 'playing'" @click.prevent="resume">
<i class="fa fa-play"></i>
</span>
<span class="pause control" v-else @click.prevent="pause">