Improve sort button
This commit is contained in:
@@ -96,6 +96,6 @@
|
||||
<!-- Go to Top Button-->
|
||||
<button type="button" class="btn btn-warning btn-top" [class.btn-top-is-visible]="atBottom"
|
||||
aria-label="Top" (click)="scrollTop()">
|
||||
<span class="glyphicon glyphicon-menu-up" style="color:white" aria-hidden="true"></span>
|
||||
<span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -114,10 +114,10 @@
|
||||
<!-- Go to Top Button-->
|
||||
<button type="button" class="btn btn-warning btn-top" [class.btn-top-is-visible]="atBottom"
|
||||
aria-label="Top" (click)="scrollTop()">
|
||||
<span class="glyphicon glyphicon-menu-up" style="color:white" aria-hidden="true"></span>
|
||||
<span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary btn-top btn-sort" [class.btn-top-is-visible]="atBottom"
|
||||
<button type="button" class="btn btn-primary btn-top btn-sort" [class.btn-top-is-visible]="sortable"
|
||||
aria-label="Top" (click)="sort()">
|
||||
<span class="glyphicon glyphicon-sort-by-attributes" style="color:white" aria-hidden="true"></span>
|
||||
<span class="glyphicon glyphicon-sort-by-attributes" aria-hidden="true"></span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -24,8 +24,11 @@ export class ArtistComponent implements OnInit {
|
||||
artistName = "";
|
||||
songs: Array<Song> = [];
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user