auto scroll top on stats table change
parent
2ba35167bc
commit
b52c5fc484
|
@ -1,4 +1,4 @@
|
|||
import {Component, EventEmitter, SimpleChanges} from "@angular/core";
|
||||
import {Component, ElementRef, EventEmitter, SimpleChanges} from "@angular/core";
|
||||
import {War} from "../../../models/model-interfaces";
|
||||
import {Fraction} from "../../../utils/fraction.enum";
|
||||
|
||||
|
@ -30,10 +30,7 @@ export class ScoreboardComponent {
|
|||
sortDescending: 'glyphicon glyphicon-triangle-bottom',
|
||||
};
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
constructor(private elRef: ElementRef) {
|
||||
}
|
||||
|
||||
selectPlayerDetail(view: number, playerName: string) {
|
||||
|
@ -41,6 +38,8 @@ export class ScoreboardComponent {
|
|||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
this.elRef.nativeElement.querySelector('.datatable-body').scrollTo(0, 0);
|
||||
|
||||
if (changes.war) {
|
||||
this.rows = changes.war.currentValue.players;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue