aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-28 17:11:07 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-28 17:13:51 +0100
commita434c465455d63a3961e778abca82150186cf171 (patch)
tree0589c09e6de09da32aaca56c95fa715d344b0e4e /client/src/app/+admin
parent80958c78fdc733c02077a9d2200be0c3f5ee623e (diff)
downloadPeerTube-a434c465455d63a3961e778abca82150186cf171.tar.gz
PeerTube-a434c465455d63a3961e778abca82150186cf171.tar.zst
PeerTube-a434c465455d63a3961e778abca82150186cf171.zip
Change tab when changing follow url
Diffstat (limited to 'client/src/app/+admin')
-rw-r--r--client/src/app/+admin/follows/follows.component.ts17
1 files changed, 15 insertions, 2 deletions
diff --git a/client/src/app/+admin/follows/follows.component.ts b/client/src/app/+admin/follows/follows.component.ts
index 97422a41b..a1be82585 100644
--- a/client/src/app/+admin/follows/follows.component.ts
+++ b/client/src/app/+admin/follows/follows.component.ts
@@ -1,11 +1,12 @@
1import { AfterViewInit, Component, ViewChild } from '@angular/core' 1import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core'
2import { NavigationEnd, Router } from '@angular/router'
2import { TabsetComponent } from 'ngx-bootstrap/tabs' 3import { TabsetComponent } from 'ngx-bootstrap/tabs'
3 4
4@Component({ 5@Component({
5 templateUrl: './follows.component.html', 6 templateUrl: './follows.component.html',
6 styleUrls: [ './follows.component.scss' ] 7 styleUrls: [ './follows.component.scss' ]
7}) 8})
8export class FollowsComponent implements AfterViewInit { 9export class FollowsComponent implements OnInit, AfterViewInit {
9 @ViewChild('followsMenuTabs') followsMenuTabs: TabsetComponent 10 @ViewChild('followsMenuTabs') followsMenuTabs: TabsetComponent
10 11
11 links = [ 12 links = [
@@ -23,6 +24,18 @@ export class FollowsComponent implements AfterViewInit {
23 } 24 }
24 ] 25 ]
25 26
27 constructor (private router: Router) {}
28
29 ngOnInit () {
30 this.router.events.subscribe(
31 event => {
32 if (event instanceof NavigationEnd) {
33 this.updateActiveTab()
34 }
35 }
36 )
37 }
38
26 ngAfterViewInit () { 39 ngAfterViewInit () {
27 // Avoid issue with change detector 40 // Avoid issue with change detector
28 setTimeout(() => this.updateActiveTab()) 41 setTimeout(() => this.updateActiveTab())