diff options
Diffstat (limited to 'client/src/app/+about/about-peertube/about-peertube.component.ts')
-rw-r--r-- | client/src/app/+about/about-peertube/about-peertube.component.ts | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/client/src/app/+about/about-peertube/about-peertube.component.ts b/client/src/app/+about/about-peertube/about-peertube.component.ts index 64fd30837..98c5f93c3 100644 --- a/client/src/app/+about/about-peertube/about-peertube.component.ts +++ b/client/src/app/+about/about-peertube/about-peertube.component.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | import { Component } from '@angular/core' | 1 | import { Component, AfterViewChecked } from '@angular/core' |
2 | import { ViewportScroller } from '@angular/common' | ||
2 | 3 | ||
3 | @Component({ | 4 | @Component({ |
4 | selector: 'my-about-peertube', | 5 | selector: 'my-about-peertube', |
@@ -6,5 +7,12 @@ import { Component } from '@angular/core' | |||
6 | styleUrls: [ './about-peertube.component.scss' ] | 7 | styleUrls: [ './about-peertube.component.scss' ] |
7 | }) | 8 | }) |
8 | 9 | ||
9 | export class AboutPeertubeComponent { | 10 | export class AboutPeertubeComponent implements AfterViewChecked { |
11 | constructor ( | ||
12 | private viewportScroller: ViewportScroller | ||
13 | ) {} | ||
14 | |||
15 | ngAfterViewChecked () { | ||
16 | if (window.location.hash) this.viewportScroller.scrollToAnchor(window.location.hash.replace('#', '')) | ||
17 | } | ||
10 | } | 18 | } |