+
diff --git a/src/app/showcase/layout/topbar/app.topbar.component.ts b/src/app/showcase/layout/topbar/app.topbar.component.ts
index 2f5ecc4e996..70213969639 100644
--- a/src/app/showcase/layout/topbar/app.topbar.component.ts
+++ b/src/app/showcase/layout/topbar/app.topbar.component.ts
@@ -3,6 +3,7 @@ import { Component, ElementRef, EventEmitter, Inject, Input, OnDestroy, OnInit,
import { FormsModule } from '@angular/forms';
import { Router, RouterModule } from '@angular/router';
import docsearch from '@docsearch/js';
+import { DomHandler } from 'primeng/dom';
import { StyleClassModule } from 'primeng/styleclass';
import Versions from '../../data/versions.json';
import { AppConfigService } from '../../service/appconfigservice';
@@ -41,8 +42,14 @@ export class AppTopBarComponent implements OnInit, OnDestroy {
}
}
- showMenu() {
- this.configService.showMenu();
+ toggleMenu() {
+ if (this.configService.state.menuActive) {
+ this.configService.hideMenu();
+ DomHandler.unblockBodyScroll('blocked-scroll');
+ } else {
+ this.configService.showMenu();
+ DomHandler.blockBodyScroll('blocked-scroll');
+ }
}
showConfig() {