mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-06-28 23:25:13 +00:00
Move deploy blur logic to parent component
This commit is contained in:
@ -1,7 +1,9 @@
|
||||
<div class="tfw-grid-main-components">
|
||||
<div class="tfw-header"><app-header></app-header></div>
|
||||
<div class="tfw-messages"><app-messages></app-messages></div>
|
||||
<div class="tfw-web tao-grid-top-left"><app-login></app-login></div>
|
||||
<div class="tfw-web tao-grid-top-left" [ngClass]="{ 'deploy-blur': deploying }">
|
||||
<app-login></app-login>
|
||||
</div>
|
||||
<div class="tfw-webide"><app-webide></app-webide></div>
|
||||
<div class="tfw-terminal"><app-terminal></app-terminal></div>
|
||||
</div>
|
||||
|
@ -107,3 +107,8 @@ $layout: (
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.deploy-blur {
|
||||
filter: blur(3px);
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,28 @@
|
||||
import { Component } from '@angular/core';
|
||||
import {Component, OnDestroy, OnInit} from '@angular/core';
|
||||
import {DeploymentNotificationService} from '../services/deployment-notification.service';
|
||||
import {Subscription} from 'rxjs/Subscription';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dashboard',
|
||||
templateUrl: './dashboard.component.html',
|
||||
styleUrls: ['./dashboard.component.scss']
|
||||
})
|
||||
export class DashboardComponent {
|
||||
constructor() {}
|
||||
export class DashboardComponent implements OnInit, OnDestroy {
|
||||
|
||||
deploying = false;
|
||||
deploymentNotificationSubscription: Subscription;
|
||||
|
||||
constructor(private deploymentNotificationService: DeploymentNotificationService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.deploymentNotificationSubscription = this.deploymentNotificationService.deploying.subscribe(
|
||||
(deploying) => this.deploying = deploying
|
||||
);
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
if (this.deploymentNotificationSubscription) {
|
||||
this.deploymentNotificationSubscription.unsubscribe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user