aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/app.component.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-08-21 11:27:24 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-08-21 11:27:24 +0200
commitbeacf6993c93f93bf5ea86665827154eb291d1fd (patch)
tree5aa8b69bbf4891c8d34798b052236f0ebfb94963 /client/src/app/app.component.ts
parent9aa46b0c7bade696a477626ad7590ffdd281e03c (diff)
downloadPeerTube-beacf6993c93f93bf5ea86665827154eb291d1fd.tar.gz
PeerTube-beacf6993c93f93bf5ea86665827154eb291d1fd.tar.zst
PeerTube-beacf6993c93f93bf5ea86665827154eb291d1fd.zip
Client: simplify simple menu/admin menu displaying logic
Diffstat (limited to 'client/src/app/app.component.ts')
-rw-r--r--client/src/app/app.component.ts12
1 files changed, 4 insertions, 8 deletions
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts
index d9549ad5b..2e0fd13f1 100644
--- a/client/src/app/app.component.ts
+++ b/client/src/app/app.component.ts
@@ -1,5 +1,5 @@
1import { Component } from '@angular/core'; 1import { Component } from '@angular/core';
2import { ROUTER_DIRECTIVES } from '@angular/router'; 2import { Router, ROUTER_DIRECTIVES } from '@angular/router';
3 3
4import { MenuAdminComponent } from './admin'; 4import { MenuAdminComponent } from './admin';
5import { MenuComponent } from './menu.component'; 5import { MenuComponent } from './menu.component';
@@ -15,13 +15,9 @@ import { VideoService } from './videos';
15}) 15})
16 16
17export class AppComponent { 17export class AppComponent {
18 isInAdmin = false; 18 constructor(private router: Router) {}
19 19
20 onEnteredInAdmin() { 20 isInAdmin() {
21 this.isInAdmin = true; 21 return this.router.url.indexOf('/admin/') !== -1;
22 }
23
24 onQuittedAdmin() {
25 this.isInAdmin = false;
26 } 22 }
27} 23}