publish show

This commit is contained in:
2020-04-17 15:13:39 +02:00
committed by smuddy
parent b8fbcb4b9a
commit c5748d5e34
19 changed files with 126 additions and 63 deletions

View File

@@ -17,19 +17,21 @@ export type ChordMode = 'show' | 'hide' | 'onlyFirst'
})
export class SongTextComponent implements OnInit {
public sections: Section[];
public _chordMode: ChordMode = 'hide';
@Input() public scrollIndex = 0;
@Input() showSwitch = false;
@Input()
public set chordMode(value: ChordMode) {
this._chordMode = value ?? 'hide';
}
@Output() public chordModeChanged = new EventEmitter<ChordMode>();
public faLines = faGripLines;
constructor(private textRenderingService: TextRenderingService, private elRef: ElementRef) {
}
public _chordMode: ChordMode = 'hide';
@Input()
public set chordMode(value: ChordMode) {
this._chordMode = value ?? 'hide';
}
@Input()
public set text(value: string) {
this.sections = this.textRenderingService.parse(value).sort((a, b) => a.type - b.type);
@@ -61,6 +63,10 @@ export class SongTextComponent implements OnInit {
this.chordModeChanged.emit(next);
}
public onClick() {
scrollTo(0, this.elRef.nativeElement.offsetTop - 20);
}
private getNextChordMode(): ChordMode {
switch (this._chordMode) {
case 'show':
@@ -71,8 +77,4 @@ export class SongTextComponent implements OnInit {
return 'show';
}
}
public onClick() {
scrollTo(0, this.elRef.nativeElement.offsetTop - 20);
}
}