mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-11 14:19:38 +00:00
Fix result table layout
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { AfterViewInit, Component, ElementRef, Input, ViewChild } from '@angular/core'
|
||||
import { Component, Input, OnInit } from '@angular/core'
|
||||
|
||||
import { ChartData } from '../../../../../../src-shared/interfaces/search.interface'
|
||||
import { SelectionService } from '../../../../core/services/selection.service'
|
||||
@@ -6,36 +6,24 @@ import { SelectionService } from '../../../../core/services/selection.service'
|
||||
@Component({
|
||||
selector: 'tr[app-result-table-row]',
|
||||
templateUrl: './result-table-row.component.html',
|
||||
styleUrls: ['./result-table-row.component.scss'],
|
||||
})
|
||||
export class ResultTableRowComponent implements AfterViewInit {
|
||||
export class ResultTableRowComponent implements OnInit {
|
||||
@Input() song: ChartData[]
|
||||
|
||||
@ViewChild('checkbox', { static: true }) checkbox: ElementRef
|
||||
|
||||
constructor(private selectionService: SelectionService) { }
|
||||
|
||||
get songID() {
|
||||
return this.song[0].songId ?? this.song[0].chartId
|
||||
ngOnInit() {
|
||||
this.selectionService.selections[this.groupId] = false
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.selectionService.onSelectionChanged(this.songID, isChecked => {
|
||||
if (isChecked) {
|
||||
// TODO
|
||||
// $(this.checkbox.nativeElement).checkbox('check')
|
||||
} else {
|
||||
// $(this.checkbox.nativeElement).checkbox('uncheck')
|
||||
}
|
||||
})
|
||||
get groupId() {
|
||||
return this.song[0].groupId
|
||||
}
|
||||
|
||||
// $(this.checkbox.nativeElement).checkbox({
|
||||
// onChecked: () => {
|
||||
// this.selectionService.selectSong(this.songID)
|
||||
// },
|
||||
// onUnchecked: () => {
|
||||
// this.selectionService.deselectSong(this.songID)
|
||||
// },
|
||||
// })
|
||||
get selected() {
|
||||
return this.selectionService.selections[this.groupId] ?? false
|
||||
}
|
||||
set selected(value: boolean) {
|
||||
this.selectionService.selections[this.groupId] = value
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user