WIP: Responsive header menu 2
This commit is contained in:
@@ -14,5 +14,5 @@
|
||||
<p>{{getUserName()}}</p>
|
||||
<img src="assets/images/user.png" alt="User Icon" (click)="openProfile()">
|
||||
</span>
|
||||
<app-profile (showProfilePopoverChange)="closeProfile()" *ngIf="showProfilePopover" [user]="this.user"></app-profile>
|
||||
<app-profile (showProfilePopOverChange)="closeProfile()" *ngIf="showProfilePopOver" [user]="this.user"></app-profile>
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,7 @@ import {StorageService} from '../../services/storage.service';
|
||||
})
|
||||
export class HeaderComponent implements OnInit {
|
||||
|
||||
showProfilePopover: boolean = false;
|
||||
showProfilePopOver: boolean = false;
|
||||
user?: User;
|
||||
|
||||
constructor() {
|
||||
@@ -20,11 +20,11 @@ export class HeaderComponent implements OnInit {
|
||||
}
|
||||
|
||||
openProfile(): void {
|
||||
this.showProfilePopover = true;
|
||||
this.showProfilePopOver = true;
|
||||
}
|
||||
|
||||
closeProfile(): void {
|
||||
this.showProfilePopover = false;
|
||||
this.showProfilePopOver = false;
|
||||
}
|
||||
|
||||
getUserName(): string {
|
||||
|
||||
@@ -10,7 +10,7 @@ export class ProfileComponent implements OnInit {
|
||||
|
||||
initialClick = true;
|
||||
@Input() user?: User;
|
||||
@Output() showProfilePopoverChange = new EventEmitter<boolean>();
|
||||
@Output() showProfilePopOverChange = new EventEmitter<boolean>();
|
||||
|
||||
constructor(private eRef: ElementRef) {
|
||||
}
|
||||
@@ -31,7 +31,7 @@ export class ProfileComponent implements OnInit {
|
||||
}
|
||||
|
||||
if (!this.eRef.nativeElement.contains(event.target)) {
|
||||
this.showProfilePopoverChange.emit(false);
|
||||
this.showProfilePopOverChange.emit(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user