Reverse order of messaging messages

This commit is contained in:
Kristóf Tóth
2018-06-26 14:13:29 +02:00
parent c6f9edc9f7
commit 8a2518fbd0
5 changed files with 31 additions and 12 deletions

View File

@ -20,6 +20,7 @@ export class DashboardComponent implements OnInit, OnDestroy {
deploying = false;
deploymentNotificationSubscription: Subscription;
@ViewChild('webiframe') webiframe: ElementRef;
@ViewChild('tfwmessages') messages: ElementRef;
layout: string = config.dashboard.currentLayout;
hideMessages: boolean = config.dashboard.hideMessages;
@ -125,4 +126,11 @@ export class DashboardComponent implements OnInit, OnDestroy {
this.selectTerminalMenuItem('console');
}
}
scrollMessagesToBottom(): void {
const element = this.messages.nativeElement;
// This must be done in the Angular event loop to avoid messing up
// change detection (not in the template like ConsoleComponent does)
element.scrollTop = element.scrollHeight;
}
}