diff --git a/dmp-frontend/src/app/ui/navbar/navbar.component.html b/dmp-frontend/src/app/ui/navbar/navbar.component.html index 8056b8715..ff72c6083 100644 --- a/dmp-frontend/src/app/ui/navbar/navbar.component.html +++ b/dmp-frontend/src/app/ui/navbar/navbar.component.html @@ -8,7 +8,7 @@
- -
+
  • diff --git a/dmp-frontend/src/app/ui/navbar/navbar.component.ts b/dmp-frontend/src/app/ui/navbar/navbar.component.ts index c705e657e..6199a6a1a 100644 --- a/dmp-frontend/src/app/ui/navbar/navbar.component.ts +++ b/dmp-frontend/src/app/ui/navbar/navbar.component.ts @@ -1,6 +1,6 @@ import { Location } from '@angular/common'; -import { Component, ElementRef, EventEmitter, OnInit, Output } from '@angular/core'; -import { MatDialog } from '@angular/material'; +import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'; +import { MatDialog, MatMenuTrigger } from '@angular/material'; import { Router } from '@angular/router'; import { AppRole } from '@app/core/common/enum/app-role'; import { AuthService } from '@app/core/services/auth/auth.service'; @@ -37,6 +37,7 @@ export class NavbarComponent extends BaseComponent implements OnInit { selectedLanguage = 'en'; private user: UserListingModel; @Output() sidebarToggled: EventEmitter = new EventEmitter(); + @ViewChild(MatMenuTrigger, {static: false}) trigger: MatMenuTrigger; constructor(location: Location, private element: ElementRef, @@ -83,6 +84,14 @@ export class NavbarComponent extends BaseComponent implements OnInit { return this.currentRoute === '/language-editor' || this.currentRoute === '/profile'; } + openMyMenu() { + this.trigger.openMenu(); + } + + closeMyMenu() { + this.trigger.closeMenu(); + } + sidebarOpen() { const toggleButton = this.toggleButton; const body = document.getElementsByTagName('body')[0];