From 67167390827ca0c6c10849f26d0deb8b32186a7e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 26 Apr 2017 21:22:00 +0200 Subject: Client: add ability to hide left menu --- client/src/app/app.component.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'client/src/app/app.component.ts') diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index c29790d96..14870bb5f 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -24,6 +24,8 @@ export class AppComponent implements OnInit { rtl: false }; + isMenuDisplayed = true; + constructor( private router: Router, private authService: AuthService, @@ -48,4 +50,26 @@ export class AppComponent implements OnInit { isInAdmin() { return this.router.url.indexOf('/admin/') !== -1; } + + toggleMenu() { + this.isMenuDisplayed = !this.isMenuDisplayed; + } + + getMainColClasses() { + const colSizes = { + md: 10, + sm: 9, + xs: 9 + } + + // Take all width is the menu is not displayed + if (this.isMenuDisplayed === false) { + Object.keys(colSizes).forEach(col => colSizes[col] = 12); + } + + const classes = [ "main-col" ]; + Object.keys(colSizes).forEach(col => classes.push(`col-${col}-${colSizes[col]}`)); + + return classes; + } } -- cgit v1.2.3