aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/app.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-31 10:08:05 +0100
committerChocobozzz <me@florianbigard.com>2018-01-31 10:08:05 +0100
commitc8cf5952f3be2dd64016c10dfe1825a6de1ec39b (patch)
treef8e8041b28bfeda4f642e975aa8db9bb924942d1 /client/src/app/app.component.ts
parent8892e8cc63fcef1ce4952b6a8e2946d730c5e8bb (diff)
downloadPeerTube-c8cf5952f3be2dd64016c10dfe1825a6de1ec39b.tar.gz
PeerTube-c8cf5952f3be2dd64016c10dfe1825a6de1ec39b.tar.zst
PeerTube-c8cf5952f3be2dd64016c10dfe1825a6de1ec39b.zip
Mobile version: menu full width and autoclosed
Diffstat (limited to 'client/src/app/app.component.ts')
-rw-r--r--client/src/app/app.component.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts
index ef8597203..ba52c2102 100644
--- a/client/src/app/app.component.ts
+++ b/client/src/app/app.component.ts
@@ -1,5 +1,5 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { Router } from '@angular/router' 2import { NavigationEnd, Router } from '@angular/router'
3import { AuthService, ServerService } from '@app/core' 3import { AuthService, ServerService } from '@app/core'
4 4
5@Component({ 5@Component({
@@ -48,6 +48,15 @@ export class AppComponent implements OnInit {
48 if (window.innerWidth < 600) { 48 if (window.innerWidth < 600) {
49 this.isMenuDisplayed = false 49 this.isMenuDisplayed = false
50 } 50 }
51
52 this.router.events.subscribe(
53 e => {
54 // User clicked on a link in the menu, change the page
55 if (e instanceof NavigationEnd && window.innerWidth < 600) {
56 this.isMenuDisplayed = false
57 }
58 }
59 )
51 } 60 }
52 61
53 toggleMenu () { 62 toggleMenu () {