From c85865418b4069b51e5b11fdea3b8997672341ea Mon Sep 17 00:00:00 2001 From: Phan An Date: Thu, 20 Apr 2017 17:39:40 +0800 Subject: [PATCH] Fix #551 --- .../assets/js/components/shared/song-list.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/resources/assets/js/components/shared/song-list.vue b/resources/assets/js/components/shared/song-list.vue index 9586b1ba..6c5cdac2 100644 --- a/resources/assets/js/components/shared/song-list.vue +++ b/resources/assets/js/components/shared/song-list.vue @@ -141,7 +141,7 @@ export default { * @return {Array.} */ selectedSongs () { - return this.songRows.filter(row => row.selected).map(row => row.song) + return this.filteredItems.filter(row => row.selected).map(row => row.song) } }, @@ -276,10 +276,10 @@ export default { }, /** - * Select all rows in the current list. + * Select all (filtered) rows in the current list. */ selectAllRows () { - each(this.songRows, row => { + each(this.filteredItems, row => { row.selected = true }) }, @@ -330,11 +330,14 @@ export default { * @param {VueComponent} secondRowVm The second row's component */ selectRowsBetween (firstRowVm, secondRowVm) { - const indexes = [this.songRows.indexOf(firstRowVm.item), this.songRows.indexOf(secondRowVm.item)] + const indexes = [ + this.filteredItems.indexOf(firstRowVm.item), + this.filteredItems.indexOf(secondRowVm.item) + ] indexes.sort((a, b) => a - b) for (let i = indexes[0]; i <= indexes[1]; ++i) { - this.songRows[i].selected = true + this.filteredItems[i].selected = true } }, @@ -342,7 +345,7 @@ export default { * Clear the current selection on this song list. */ clearSelection () { - each(this.songRows, row => { + each(this.filteredItems, row => { row.selected = false }) },