X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fapp.component.ts;h=14870bb5f8c2c876b50d011a8f98732792dd01a0;hb=67167390827ca0c6c10849f26d0deb8b32186a7e;hp=3c06b320e03a873b1eb94f974026e58f56f513cd;hpb=92fb909c9b4a92a00b0d0da7629e6fb003de281b;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index 3c06b320e..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, @@ -42,9 +44,32 @@ export class AppComponent implements OnInit { this.configService.loadConfig(); this.videoService.loadVideoCategories(); this.videoService.loadVideoLicences(); + this.videoService.loadVideoLanguages(); } 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; + } }