Use computed for wiki panel

This commit is contained in:
An Phan 2016-10-31 12:00:26 +07:00
parent 2df42065f7
commit 4e1ff0fc7a
No known key found for this signature in database
GPG key ID: 05536BB4BCDC02A2

View file

@ -10,11 +10,10 @@
<img v-if="album.info.image" :src="album.info.image" class="cover">
<div class="wiki" v-if="album.info.wiki && album.info.wiki.summary">
<div class="summary" v-show="mode !== 'full' && !showingFullWiki" v-html="album.info.wiki.summary"/>
<div class="full" v-show="mode === 'full' || showingFullWiki" v-html="album.info.wiki.full"/>
<div class="summary" v-show="showSummary" v-html="album.info.wiki.summary"/>
<div class="full" v-show="showFull" v-html="album.info.wiki.full"/>
<button class="more" v-show="mode !== 'full' && !showingFullWiki"
@click.prevent="showingFullWiki = !showingFullWiki">
<button class="more" v-show="showSummary" @click.prevent="showingFullWiki = true">
Full Wiki
</button>
</div>
@ -55,6 +54,16 @@ export default {
},
},
computed {
showSummary() {
return this.mode !== 'full' && !this.showingFullWiki;
},
showFull() {
return this.mode === 'full' || this.showingFullWiki;
},
},
methods: {
/**
* Shuffle all songs in the current album.