diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-08-21 11:27:24 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-08-21 11:27:24 +0200 |
commit | beacf6993c93f93bf5ea86665827154eb291d1fd (patch) | |
tree | 5aa8b69bbf4891c8d34798b052236f0ebfb94963 /client/src/app/app.component.ts | |
parent | 9aa46b0c7bade696a477626ad7590ffdd281e03c (diff) | |
download | PeerTube-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.ts | 12 |
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 @@ | |||
1 | import { Component } from '@angular/core'; | 1 | import { Component } from '@angular/core'; |
2 | import { ROUTER_DIRECTIVES } from '@angular/router'; | 2 | import { Router, ROUTER_DIRECTIVES } from '@angular/router'; |
3 | 3 | ||
4 | import { MenuAdminComponent } from './admin'; | 4 | import { MenuAdminComponent } from './admin'; |
5 | import { MenuComponent } from './menu.component'; | 5 | import { MenuComponent } from './menu.component'; |
@@ -15,13 +15,9 @@ import { VideoService } from './videos'; | |||
15 | }) | 15 | }) |
16 | 16 | ||
17 | export class AppComponent { | 17 | export 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 | } |