diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-04-26 21:22:00 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-04-26 21:23:19 +0200 |
commit | 67167390827ca0c6c10849f26d0deb8b32186a7e (patch) | |
tree | f2c2732c287b175bad289968721de3063b633ee6 /client/src/app/app.component.ts | |
parent | d1a00ddbe245ee6cd2837025fb7757b22465dd11 (diff) | |
download | PeerTube-67167390827ca0c6c10849f26d0deb8b32186a7e.tar.gz PeerTube-67167390827ca0c6c10849f26d0deb8b32186a7e.tar.zst PeerTube-67167390827ca0c6c10849f26d0deb8b32186a7e.zip |
Client: add ability to hide left menu
Diffstat (limited to 'client/src/app/app.component.ts')
-rw-r--r-- | client/src/app/app.component.ts | 24 |
1 files changed, 24 insertions, 0 deletions
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 { | |||
24 | rtl: false | 24 | rtl: false |
25 | }; | 25 | }; |
26 | 26 | ||
27 | isMenuDisplayed = true; | ||
28 | |||
27 | constructor( | 29 | constructor( |
28 | private router: Router, | 30 | private router: Router, |
29 | private authService: AuthService, | 31 | private authService: AuthService, |
@@ -48,4 +50,26 @@ export class AppComponent implements OnInit { | |||
48 | isInAdmin() { | 50 | isInAdmin() { |
49 | return this.router.url.indexOf('/admin/') !== -1; | 51 | return this.router.url.indexOf('/admin/') !== -1; |
50 | } | 52 | } |
53 | |||
54 | toggleMenu() { | ||
55 | this.isMenuDisplayed = !this.isMenuDisplayed; | ||
56 | } | ||
57 | |||
58 | getMainColClasses() { | ||
59 | const colSizes = { | ||
60 | md: 10, | ||
61 | sm: 9, | ||
62 | xs: 9 | ||
63 | } | ||
64 | |||
65 | // Take all width is the menu is not displayed | ||
66 | if (this.isMenuDisplayed === false) { | ||
67 | Object.keys(colSizes).forEach(col => colSizes[col] = 12); | ||
68 | } | ||
69 | |||
70 | const classes = [ "main-col" ]; | ||
71 | Object.keys(colSizes).forEach(col => classes.push(`col-${col}-${colSizes[col]}`)); | ||
72 | |||
73 | return classes; | ||
74 | } | ||
51 | } | 75 | } |