Add an amazing (and bugged) sort button for artist

Just for test purpose - need to be improved
This commit is contained in:
2017-05-05 04:26:09 +02:00
parent 6c55117c0d
commit c0d6459d0b
3 changed files with 17 additions and 1 deletions

View File

@@ -29,4 +29,9 @@
/* the button becomes visible */ /* the button becomes visible */
visibility: visible; visibility: visible;
opacity: 1; opacity: 1;
}
.btn-sort {
bottom: 20px;
right: 70px;
} }

View File

@@ -115,4 +115,9 @@
<button type="button" class="btn btn-warning btn-top" [class.btn-top-is-visible]="atBottom" <button type="button" class="btn btn-warning btn-top" [class.btn-top-is-visible]="atBottom"
aria-label="Top" (click)="scrollTop()"> aria-label="Top" (click)="scrollTop()">
<span class="glyphicon glyphicon-menu-up" style="color:white" aria-hidden="true"></span> <span class="glyphicon glyphicon-menu-up" style="color:white" aria-hidden="true"></span>
</button> </button>
<button type="button" class="btn btn-primary btn-top btn-sort" [class.btn-top-is-visible]="atBottom"
aria-label="Top" (click)="sort()">
<span class="glyphicon glyphicon-sort-by-attributes" style="color:white" aria-hidden="true"></span>
</button>
</div>

View File

@@ -6,6 +6,8 @@ import { ElsService } from './els.service'
import { Song } from './object/song'; import { Song } from './object/song';
import { Artist } from './object/artist'; import { Artist } from './object/artist';
import { SortPipe } from './sortby.pipe'
@Component({ @Component({
selector: 'artist-component', selector: 'artist-component',
templateUrl: './artist.component.html', templateUrl: './artist.component.html',
@@ -81,4 +83,8 @@ export class ArtistComponent implements OnInit {
this.atBottom = false; this.atBottom = false;
} }
} }
sort(): void {
this.songs = new SortPipe().transform(this.songs, 'Album', 'Track Number', 'Play Count');
}
} }