From 11348abb811d02140e3a5dd274d5ac708df514a3 Mon Sep 17 00:00:00 2001 From: "Maxence G. de Montauzan" Date: Sat, 6 May 2017 14:53:22 +0200 Subject: [PATCH] Improve sort button --- dashboard/src/app/album.component.html | 2 +- dashboard/src/app/artist.component.html | 6 +++--- dashboard/src/app/artist.component.ts | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/dashboard/src/app/album.component.html b/dashboard/src/app/album.component.html index 48cad74..42a8dbf 100644 --- a/dashboard/src/app/album.component.html +++ b/dashboard/src/app/album.component.html @@ -96,6 +96,6 @@ \ No newline at end of file diff --git a/dashboard/src/app/artist.component.html b/dashboard/src/app/artist.component.html index 3f5dbf3..28dbd11 100644 --- a/dashboard/src/app/artist.component.html +++ b/dashboard/src/app/artist.component.html @@ -114,10 +114,10 @@ - \ No newline at end of file diff --git a/dashboard/src/app/artist.component.ts b/dashboard/src/app/artist.component.ts index 63f3b89..0f0f1a3 100644 --- a/dashboard/src/app/artist.component.ts +++ b/dashboard/src/app/artist.component.ts @@ -24,8 +24,11 @@ export class ArtistComponent implements OnInit { artistName = ""; songs: Array = []; artist: Artist = new Artist(); + // To activate button in interface var moreDataAvailable: boolean = false; atBottom: boolean = false; + sortable: boolean = false; + lockLoadData: boolean = true; ngOnInit(): void { @@ -48,6 +51,7 @@ export class ArtistComponent implements OnInit { if (this.songs.length == 0) { this.songs = data; } else { + this.sortable = true; data.forEach(song => { this.songs.push(song); }); @@ -86,5 +90,6 @@ export class ArtistComponent implements OnInit { sort(): void { this.songs = new SortPipe().transform(this.songs, 'Album', 'Track Number', 'Play Count'); + this.sortable = false; } } \ No newline at end of file