mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-11 14:19:38 +00:00
Rework sidebar
This commit is contained in:
@@ -7,3 +7,5 @@
|
||||
<td>{{ song[0].artist }}</td>
|
||||
<td>{{ song[0].album || 'Various' }}</td>
|
||||
<td>{{ song[0].genre || 'Various' }}</td>
|
||||
<td>{{ song[0].year || 'Various' }}</td>
|
||||
<!-- TODO: "Various" will never display -->
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<th [class.sorted]="sortColumn === 'artist'" [ngClass]="sortDirection" (click)="onColClicked('artist')">Artist</th>
|
||||
<th [class.sorted]="sortColumn === 'album'" [ngClass]="sortDirection" (click)="onColClicked('album')">Album</th>
|
||||
<th [class.sorted]="sortColumn === 'genre'" [ngClass]="sortDirection" (click)="onColClicked('genre')">Genre</th>
|
||||
<th [class.sorted]="sortColumn === 'year'" [ngClass]="sortDirection" (click)="onColClicked('year')">Year</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -23,7 +23,7 @@ export class ResultTableComponent implements OnInit {
|
||||
|
||||
activeSong: ChartData[] | null = null
|
||||
sortDirection: 'ascending' | 'descending' = 'descending'
|
||||
sortColumn: 'name' | 'artist' | 'album' | 'genre' | null = null
|
||||
sortColumn: 'name' | 'artist' | 'album' | 'genre' | 'year' | null = null
|
||||
|
||||
constructor(
|
||||
public searchService: SearchService,
|
||||
@@ -49,7 +49,7 @@ export class ResultTableComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
onColClicked(column: 'name' | 'artist' | 'album' | 'genre') {
|
||||
onColClicked(column: 'name' | 'artist' | 'album' | 'genre' | 'year') {
|
||||
if (this.songs.length === 0) { return }
|
||||
if (this.sortColumn !== column) {
|
||||
this.sortColumn = column
|
||||
|
||||
Reference in New Issue
Block a user