Formatting, adding comments
This commit is contained in:
parent
0889c101aa
commit
b300fe1b7b
|
@ -7,7 +7,7 @@
|
||||||
<div (click)="navigate('/stats')">Stats</div>
|
<div (click)="navigate('/stats')">Stats</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="menu-mobile">
|
<div id="menu-mobile">
|
||||||
<div id="menu-mobile-dropdown-button" (click)="openMobileDropdown()">Open</div>
|
<div id="menu-mobile-dropdown-button" (click)="toggleMobileDropdown()">Open</div>
|
||||||
<div id="menu-mobile-dropdown-content">
|
<div id="menu-mobile-dropdown-content">
|
||||||
<div (click)="navigate('/')">Home</div>
|
<div (click)="navigate('/')">Home</div>
|
||||||
<div (click)="navigate('/gamenight')">Game night</div>
|
<div (click)="navigate('/gamenight')">Game night</div>
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
display: inherit;
|
display: inherit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media(max-width: 767px) {
|
@media(max-width: 767px) {
|
||||||
#menu-desktop {
|
#menu-desktop {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import {Component, OnInit} from '@angular/core';
|
import {Component, OnInit} from '@angular/core';
|
||||||
import {User} from '../../models/user';
|
import {User} from '../../models/user';
|
||||||
import {StorageService} from '../../services/storage.service';
|
import {StorageService} from '../../services/storage.service';
|
||||||
import {Router} from "@angular/router";
|
import {Router} from '@angular/router';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-header',
|
selector: 'app-header',
|
||||||
|
@ -13,7 +13,7 @@ export class HeaderComponent implements OnInit {
|
||||||
showProfilePopOver: boolean = false;
|
showProfilePopOver: boolean = false;
|
||||||
user?: User;
|
user?: User;
|
||||||
|
|
||||||
constructor(private router:Router) {
|
constructor(private router: Router) {
|
||||||
this.user = StorageService.getUserInfo();
|
this.user = StorageService.getUserInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,20 +28,22 @@ export class HeaderComponent implements OnInit {
|
||||||
this.showProfilePopOver = false;
|
this.showProfilePopOver = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
getUserName(): string {
|
getUserName(): string {
|
||||||
return this.user ? this.user.firstName : 'Logged out';
|
return this.user ? this.user.firstName : 'Logged out';
|
||||||
}
|
}
|
||||||
|
|
||||||
navigate(path:String) : void {
|
navigate(path: String): void {
|
||||||
this.router.navigate([path]);
|
this.router.navigate([path]);
|
||||||
}
|
}
|
||||||
|
|
||||||
openMobileDropdown() : void {
|
toggleMobileDropdown(): void {
|
||||||
const dropdownContentStyle = document.getElementById("menu-mobile-dropdown-content")!.style;
|
const dropdownContentStyle = document.getElementById('menu-mobile-dropdown-content')!.style;
|
||||||
if(dropdownContentStyle.display == "block")
|
if (dropdownContentStyle.display == 'block') {
|
||||||
dropdownContentStyle.display = "none";
|
//FIXME: Currently doesn't work because content overlaps button
|
||||||
else {
|
dropdownContentStyle.display = 'none';
|
||||||
dropdownContentStyle.display = "block";
|
} else {
|
||||||
|
dropdownContentStyle.display = 'block';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user