mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-12 06:30:37 +00:00
Mark selected row as active
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#tableRow
|
||||
*ngFor="let result of results"
|
||||
(click)="onRowClicked(result)"
|
||||
[class.active]="activeRowID == result.id"
|
||||
[result]="result"></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -18,6 +18,7 @@ export class ResultTableComponent implements OnInit {
|
||||
@ViewChildren('tableRow') tableRows: QueryList<ResultTableRowComponent>
|
||||
|
||||
results: SongResult[]
|
||||
activeRowID: number = null
|
||||
|
||||
constructor(private searchService: SearchService, private selectionService: SelectionService) { }
|
||||
|
||||
@@ -27,11 +28,13 @@ export class ResultTableComponent implements OnInit {
|
||||
})
|
||||
|
||||
this.searchService.onSearchChanged(results => {
|
||||
this.activeRowID = null
|
||||
this.results = results
|
||||
})
|
||||
}
|
||||
|
||||
onRowClicked(result: SongResult) {
|
||||
this.activeRowID = result.id
|
||||
this.rowClicked.emit(result)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user