diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-31 10:42:01 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-31 10:42:01 +0100 |
commit | 6693df9dd60e6966186bcb7765218596de7b65c0 (patch) | |
tree | d0aa0ac674b95e19be3c2169c78fdbc11377f4ef /client/src/app/app.component.ts | |
parent | 61bbc7277501692d1520a421dff5af5d38ba6cf4 (diff) | |
download | PeerTube-6693df9dd60e6966186bcb7765218596de7b65c0.tar.gz PeerTube-6693df9dd60e6966186bcb7765218596de7b65c0.tar.zst PeerTube-6693df9dd60e6966186bcb7765218596de7b65c0.zip |
Hide description previews on mobile view
Diffstat (limited to 'client/src/app/app.component.ts')
-rw-r--r-- | client/src/app/app.component.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index 584640290..d2678096f 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { NavigationEnd, Router } from '@angular/router' | 2 | import { NavigationEnd, Router } from '@angular/router' |
3 | import { AuthService, ServerService } from '@app/core' | 3 | import { AuthService, ServerService } from '@app/core' |
4 | import { isInMobileView } from '@app/shared/misc/utils' | ||
4 | 5 | ||
5 | @Component({ | 6 | @Component({ |
6 | selector: 'my-app', | 7 | selector: 'my-app', |
@@ -49,14 +50,14 @@ export class AppComponent implements OnInit { | |||
49 | this.serverService.loadVideoPrivacies() | 50 | this.serverService.loadVideoPrivacies() |
50 | 51 | ||
51 | // Do not display menu on small screens | 52 | // Do not display menu on small screens |
52 | if (window.innerWidth < 600) { | 53 | if (isInMobileView()) { |
53 | this.isMenuDisplayed = false | 54 | this.isMenuDisplayed = false |
54 | } | 55 | } |
55 | 56 | ||
56 | this.router.events.subscribe( | 57 | this.router.events.subscribe( |
57 | e => { | 58 | e => { |
58 | // User clicked on a link in the menu, change the page | 59 | // User clicked on a link in the menu, change the page |
59 | if (e instanceof NavigationEnd && window.innerWidth < 600) { | 60 | if (e instanceof NavigationEnd && isInMobileView()) { |
60 | this.isMenuDisplayed = false | 61 | this.isMenuDisplayed = false |
61 | } | 62 | } |
62 | } | 63 | } |