Mark selected row as active

This commit is contained in:
Geomitron
2020-05-28 18:20:58 -04:00
parent 19faaffb27
commit 58a0116662
3 changed files with 5 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "bridge",
"version": "0.0.0",
"version": "0.0.1",
"description": "A Clone Hero library management tool with built in chart searching and downloading.",
"homepage": "https://github.com/Geomitron/Bridge",
"license": "GPL-3.0",

View File

@@ -22,6 +22,7 @@
#tableRow
*ngFor="let result of results"
(click)="onRowClicked(result)"
[class.active]="activeRowID == result.id"
[result]="result"></tr>
</tbody>
</table>

View File

@@ -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)
}