optimizing mobile song text view
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user