Various refactor

This commit is contained in:
An Phan 2016-11-18 14:30:30 +08:00
parent b058ea5c42
commit 3bd6f574fd
No known key found for this signature in database
GPG key ID: 05536BB4BCDC02A2
7 changed files with 4 additions and 36 deletions

View file

@ -66,8 +66,6 @@ export default {
return {
sharedState: sharedStore.state,
album: albumStore.stub,
isPhone: isMobile.phone,
showingControls: false,
info: {
showing: false,
loading: true,

View file

@ -65,8 +65,6 @@ export default {
return {
sharedState: sharedStore.state,
artist: artistStore.stub,
isPhone: isMobile.phone,
showingControls: false,
info: {
showing: false,
loading: true,

View file

@ -51,19 +51,10 @@ export default {
return {
state: favoriteStore.state,
sharedState: sharedStore.state,
isPhone: isMobile.phone,
showingControls: false,
};
},
methods: {
/**
* Shuffle the current favorite songs.
*/
shuffle() {
playback.queueAndPlay(this.state.songs, true);
},
/**
* Download all favorite songs.
*/
@ -79,12 +70,6 @@ export default {
@import "../../../../sass/partials/_mixins.scss";
#favoritesWrapper {
button.play-shuffle, button.del {
i {
margin-right: 0 !important;
}
}
.none {
color: $color2ndText;
padding: 16px 24px;

View file

@ -18,7 +18,7 @@
</span>
<song-list-controls
v-show="playlist.songs.length && (!isPhone || showingControls)"
v-show="!isPhone || showingControls"
@shuffleAll="shuffleAll"
@shuffleSelected="shuffleSelected"
@deletePlaylist="confirmDelete"
@ -55,9 +55,6 @@ export default {
return {
playlist: playlistStore.stub,
sharedState: sharedStore.state,
songListControlConfig: {
deletePlaylist: true,
},
};
},

View file

@ -47,8 +47,6 @@ export default {
data() {
return {
state: queueStore.state,
showingAddToMenu: false,
playlistName: '',
songListControlConfig: {
clearQueue: true,
}

View file

@ -2,13 +2,13 @@
<div class="buttons song-list-controls">
<button class="btn btn-orange btn-shuffle-all"
@click.prevent="shuffle"
v-if="selectedSongs.length < 2">
v-if="fullConfig.shuffle && selectedSongs.length < 2">
<i class="fa fa-random"></i> All
</button>
<button class="btn btn-orange btn-shuffle-selected"
@click.prevent="shuffleSelected"
v-if="selectedSongs.length > 1">
v-if="fullConfig.shuffle && selectedSongs.length > 1">
<i class="fa fa-random"></i> Selected
</button>
@ -78,15 +78,10 @@ export default {
},
mounted() {
this.mergeConfig();
this.$watch('config', this.mergeConfig, { deep: true });
assign(this.fullConfig, this.config);
},
methods: {
mergeConfig() {
this.fullConfig = assign(this.fullConfig, this.config);
},
shuffle() {
this.$emit('shuffleAll');
},

View file

@ -341,11 +341,8 @@ export default {
this.gatherSelected();
}
console.log('selected songs before drop:', this.selectedSongs);
this.$nextTick(() => {
const songIds = map(this.selectedSongs, 'id');
console.log('dragging', songIds);
e.dataTransfer.setData('application/x-koel.text+plain', songIds);
e.dataTransfer.effectAllowed = 'move';