optimizing mobile song text view

This commit is contained in:
2020-03-22 16:08:17 +01:00
committed by smuddy
parent a50d988f9b
commit 760964fb69
6 changed files with 22 additions and 14 deletions

View File

@@ -1,12 +1,10 @@
<div [class.chords]="_chordMode!=='hide'" class="song-text">
<div (click)="onClick()" [class.chords]="_chordMode!=='hide'" class="song-text">
<div (click)="onChordClick()" class="menu">
<fa-icon [icon]="faLines"></fa-icon>
</div>
<div *ngFor="let section of sections" [class.chorus]="section.type===1" class="section">
<div *ngFor="let line of getLines(section)" [class.chord]="line.type===0" class="line">
{{line.text}}
</div>
<div *ngFor="let line of getLines(section)" [class.chord]="line.type===0" class="line">{{line.text}}</div>
</div>
</div>

View File

@@ -1,4 +1,4 @@
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {Component, ElementRef, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {
Line,
LineType,
@@ -26,7 +26,7 @@ export class SongTextComponent implements OnInit {
@Output() public chordModeChanged = new EventEmitter<ChordMode>();
public faLines = faGripLines;
constructor(private textRenderingService: TextRenderingService) {
constructor(private textRenderingService: TextRenderingService, private elRef: ElementRef) {
}
@Input()
@@ -71,4 +71,7 @@ export class SongTextComponent implements OnInit {
}
}
public onClick() {
scrollTo(0, this.elRef.nativeElement.offsetTop - 20);
}
}