Skip to content
Snippets Groups Projects
Commit 05858685 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch '99-play-now' into 'develop'

Resolve "Make the play icon more explicit"

Closes #99 and #156

See merge request funkwhale/funkwhale!184
parents 60608c03 c70dc9b7
No related branches found
No related tags found
No related merge requests found
Play button now play tracks immediately instead of appending them to the queue (#99, #156)
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div :class="['ui', {'tiny': discrete}, 'buttons']"> <div :class="['ui', {'tiny': discrete}, 'buttons']">
<button <button
:title="$t('Add to current queue')" :title="$t('Add to current queue')"
@click="add" @click="addNext(true)"
:class="['ui', {loading: isLoading}, {'mini': discrete}, {disabled: !playable}, 'button']"> :class="['ui', {loading: isLoading}, {'mini': discrete}, {disabled: !playable}, 'button']">
<i class="ui play icon"></i> <i class="ui play icon"></i>
<template v-if="!discrete"><slot><i18next path="Play"/></slot></template> <template v-if="!discrete"><slot><i18next path="Play"/></slot></template>
...@@ -42,9 +42,7 @@ export default { ...@@ -42,9 +42,7 @@ export default {
} }
}, },
mounted () { mounted () {
if (!this.discrete) { jQuery(this.$el).find('.ui.dropdown').dropdown()
jQuery(this.$el).find('.ui.dropdown').dropdown()
}
}, },
computed: { computed: {
playable () { playable () {
...@@ -98,9 +96,11 @@ export default { ...@@ -98,9 +96,11 @@ export default {
addNext (next) { addNext (next) {
let self = this let self = this
this.triggerLoad() this.triggerLoad()
let wasEmpty = this.$store.state.queue.tracks.length === 0
this.getPlayableTracks().then((tracks) => { this.getPlayableTracks().then((tracks) => {
self.$store.dispatch('queue/appendMany', {tracks: tracks, index: self.$store.state.queue.currentIndex + 1}) self.$store.dispatch('queue/appendMany', {tracks: tracks, index: self.$store.state.queue.currentIndex + 1})
if (next) { let goNext = next && !wasEmpty
if (goNext) {
self.$store.dispatch('queue/next') self.$store.dispatch('queue/next')
} }
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment