From 84b15688f1825297443620044de2816fad1b7239 Mon Sep 17 00:00:00 2001 From: Oskar Rough Date: Mon, 1 Jan 2018 11:27:00 +0100 Subject: [PATCH 01/11] Get rid of extra method --- src/TrackItem.vue | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/TrackItem.vue b/src/TrackItem.vue index 2edcaa2c..2c0fa5aa 100644 --- a/src/TrackItem.vue +++ b/src/TrackItem.vue @@ -1,5 +1,5 @@ @@ -31,17 +31,6 @@ export default { if (this.track && this.track.ytid) return 'youtube' return undefined } - }, - methods: { - playProvider() { - this.$emit('play') - }, - pauseProvider() { - this.$emit('pause') - }, - trackEnded() { - this.$emit('trackEnded') - } } } diff --git a/src/TrackList.vue b/src/TrackList.vue index 900084af..d4d467bb 100644 --- a/src/TrackList.vue +++ b/src/TrackList.vue @@ -8,7 +8,7 @@ :track="track" :channelSlug="channelSlug" :class="{active : currentTrackIndex === index}" - @select="select"> + @select="$emit('select', track)">
@@ -39,9 +39,6 @@ export default { } }, methods: { - select(track) { - this.$emit('select', track) - }, locateCurrentTrack() { if (isNaN(this.currentTrackIndex)) return const container = this.$el.querySelector('.TrackList-list'); From 2fb54d26e0641f5259a0b98e92f3a50a25899ae1 Mon Sep 17 00:00:00 2001 From: Oskar Rough Date: Mon, 1 Jan 2018 11:34:01 +0100 Subject: [PATCH 07/11] One less duplication --- src/TrackList.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/TrackList.vue b/src/TrackList.vue index d4d467bb..9643b586 100644 --- a/src/TrackList.vue +++ b/src/TrackList.vue @@ -1,6 +1,7 @@