2015-12-13 04:42:28 +00:00
|
|
|
<template>
|
|
|
|
<section id="songsWrapper">
|
|
|
|
<h1 class="heading">
|
|
|
|
<span>All Songs
|
|
|
|
<i class="fa fa-chevron-down toggler"
|
|
|
|
v-show="isPhone && !showingControls"
|
|
|
|
@click="showingControls = true"></i>
|
|
|
|
<i class="fa fa-chevron-up toggler"
|
|
|
|
v-show="isPhone && showingControls"
|
|
|
|
@click.prevent="showingControls = false"></i>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<div class="buttons" v-show="!isPhone || showingControls">
|
2015-12-14 04:25:42 +00:00
|
|
|
<button
|
|
|
|
class="play-shuffle"
|
|
|
|
@click.prevent="shuffle"
|
|
|
|
v-if="state.songs.length && selectedSongs.length < 2"
|
|
|
|
>
|
2015-12-13 04:42:28 +00:00
|
|
|
<i class="fa fa-random"></i> All
|
|
|
|
</button>
|
2015-12-14 04:25:42 +00:00
|
|
|
<button class="play-shuffle" @click.prevent="shuffleSelected" v-if="selectedSongs.length > 1">
|
|
|
|
<i class="fa fa-random"></i> Selected
|
|
|
|
</button>
|
2016-01-03 10:24:12 +00:00
|
|
|
|
|
|
|
<button class="save"
|
|
|
|
@click.prevent="showAddToPlaylistDialog = !showAddToPlaylistDialog"
|
|
|
|
v-if="selectedSongs.length > 0"
|
|
|
|
>
|
|
|
|
{{ showAddToPlaylistDialog ? 'Cancel' : 'Add To…' }}
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<add-to-playlist
|
|
|
|
:songs="selectedSongs"
|
|
|
|
:showing.sync="showAddToPlaylistDialog">
|
|
|
|
</add-to-playlist>
|
2015-12-13 04:42:28 +00:00
|
|
|
</div>
|
|
|
|
</h1>
|
|
|
|
|
2015-12-14 04:25:42 +00:00
|
|
|
<song-list :items="state.songs" :selected-songs.sync="selectedSongs"></song-list>
|
2015-12-13 04:42:28 +00:00
|
|
|
</section>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import isMobile from 'ismobilejs';
|
|
|
|
|
|
|
|
import songList from '../../shared/song-list.vue';
|
2016-01-03 10:24:12 +00:00
|
|
|
import addToPlaylist from '../../shared/add-to-playlist.vue';
|
2015-12-13 04:42:28 +00:00
|
|
|
import songStore from '../../../stores/song';
|
|
|
|
import playback from '../../../services/playback';
|
2015-12-14 04:25:42 +00:00
|
|
|
import shuffleSelectedMixin from '../../../mixins/shuffle-selected';
|
2015-12-13 04:42:28 +00:00
|
|
|
|
|
|
|
export default {
|
2015-12-14 04:25:42 +00:00
|
|
|
mixins: [shuffleSelectedMixin],
|
|
|
|
|
2016-01-03 10:24:12 +00:00
|
|
|
components: { songList, addToPlaylist },
|
2015-12-13 04:42:28 +00:00
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
state: songStore.state,
|
|
|
|
isPhone: isMobile.phone,
|
|
|
|
showingControls: false,
|
2016-01-03 10:24:12 +00:00
|
|
|
showAddToPlaylistDialog: false,
|
2015-12-13 04:42:28 +00:00
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
/**
|
|
|
|
* Shuffle all songs.
|
|
|
|
*/
|
|
|
|
shuffle() {
|
|
|
|
// A null here tells the method to shuffle all songs, which is what we want.
|
|
|
|
playback.queueAndPlay(null, true);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="sass">
|
|
|
|
@import "resources/assets/sass/partials/_vars.scss";
|
|
|
|
@import "resources/assets/sass/partials/_mixins.scss";
|
|
|
|
|
|
|
|
#songsWrapper {
|
|
|
|
.none {
|
|
|
|
color: $color2ndText;
|
|
|
|
margin-top: 16px;
|
|
|
|
}
|
2016-01-03 10:24:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
button.save {
|
|
|
|
background-color: $colorGreen !important;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background-color: darken($colorGreen, 10%) !important;
|
|
|
|
}
|
|
|
|
}
|
2015-12-13 04:42:28 +00:00
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|