Formatting, adding comments

This commit is contained in:
2022-09-08 17:41:10 +02:00
parent 0889c101aa
commit b300fe1b7b
3 changed files with 13 additions and 10 deletions
+11 -9
View File
@@ -1,7 +1,7 @@
import {Component, OnInit} from '@angular/core';
import {User} from '../../models/user';
import {StorageService} from '../../services/storage.service';
import {Router} from "@angular/router";
import {Router} from '@angular/router';
@Component({
selector: 'app-header',
@@ -13,7 +13,7 @@ export class HeaderComponent implements OnInit {
showProfilePopOver: boolean = false;
user?: User;
constructor(private router:Router) {
constructor(private router: Router) {
this.user = StorageService.getUserInfo();
}
@@ -28,20 +28,22 @@ export class HeaderComponent implements OnInit {
this.showProfilePopOver = false;
}
getUserName(): string {
return this.user ? this.user.firstName : 'Logged out';
}
navigate(path:String) : void {
navigate(path: String): void {
this.router.navigate([path]);
}
openMobileDropdown() : void {
const dropdownContentStyle = document.getElementById("menu-mobile-dropdown-content")!.style;
if(dropdownContentStyle.display == "block")
dropdownContentStyle.display = "none";
else {
dropdownContentStyle.display = "block";
toggleMobileDropdown(): void {
const dropdownContentStyle = document.getElementById('menu-mobile-dropdown-content')!.style;
if (dropdownContentStyle.display == 'block') {
//FIXME: Currently doesn't work because content overlaps button
dropdownContentStyle.display = 'none';
} else {
dropdownContentStyle.display = 'block';
}
}
}