mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-07-07 18:45:09 +00:00
Mark selected row as active
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bridge",
|
"name": "bridge",
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"description": "A Clone Hero library management tool with built in chart searching and downloading.",
|
"description": "A Clone Hero library management tool with built in chart searching and downloading.",
|
||||||
"homepage": "https://github.com/Geomitron/Bridge",
|
"homepage": "https://github.com/Geomitron/Bridge",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#tableRow
|
#tableRow
|
||||||
*ngFor="let result of results"
|
*ngFor="let result of results"
|
||||||
(click)="onRowClicked(result)"
|
(click)="onRowClicked(result)"
|
||||||
|
[class.active]="activeRowID == result.id"
|
||||||
[result]="result"></tr>
|
[result]="result"></tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@@ -18,6 +18,7 @@ export class ResultTableComponent implements OnInit {
|
|||||||
@ViewChildren('tableRow') tableRows: QueryList<ResultTableRowComponent>
|
@ViewChildren('tableRow') tableRows: QueryList<ResultTableRowComponent>
|
||||||
|
|
||||||
results: SongResult[]
|
results: SongResult[]
|
||||||
|
activeRowID: number = null
|
||||||
|
|
||||||
constructor(private searchService: SearchService, private selectionService: SelectionService) { }
|
constructor(private searchService: SearchService, private selectionService: SelectionService) { }
|
||||||
|
|
||||||
@@ -27,11 +28,13 @@ export class ResultTableComponent implements OnInit {
|
|||||||
})
|
})
|
||||||
|
|
||||||
this.searchService.onSearchChanged(results => {
|
this.searchService.onSearchChanged(results => {
|
||||||
|
this.activeRowID = null
|
||||||
this.results = results
|
this.results = results
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
onRowClicked(result: SongResult) {
|
onRowClicked(result: SongResult) {
|
||||||
|
this.activeRowID = result.id
|
||||||
this.rowClicked.emit(result)
|
this.rowClicked.emit(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user