mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-06-28 17:45:11 +00:00
Reverse order of messaging messages
This commit is contained in:
@ -4,8 +4,10 @@
|
||||
<div [attr.class]="layout">
|
||||
<div class="tfw-grid-main-components">
|
||||
<div class="tfw-header"><app-header></app-header></div>
|
||||
<div [ngClass]="{'hide-attribute': hideMessages}" class="tfw-messages">
|
||||
<app-messages></app-messages>
|
||||
<div [ngClass]="{'hide-attribute': hideMessages}"
|
||||
class="tfw-messages"
|
||||
#tfwmessages>
|
||||
<app-messages (newMessageEvent)="scrollMessagesToBottom()"></app-messages>
|
||||
</div>
|
||||
<div class="tfw-web tao-grid-top-left"
|
||||
[ngClass]="{'deploy-blur': deploying}">
|
||||
|
@ -58,6 +58,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
.tfw-messages::-webkit-scrollbar {
|
||||
width: 0px;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.tfw-ide {
|
||||
background-color: #1e1e1e; // vscode dark theme
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user