diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-03-07 13:50:26 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-03-10 16:22:52 +0100 |
commit | 3b20bdd6dc7402b0723e038c57f0606131e20e54 (patch) | |
tree | 68b203892c15c524f57651bfda7e6d5c0e920443 /client/src/app/app-routing.module.ts | |
parent | 7b81edc854902a536083298472bf92bb6726edcf (diff) | |
download | PeerTube-3b20bdd6dc7402b0723e038c57f0606131e20e54.tar.gz PeerTube-3b20bdd6dc7402b0723e038c57f0606131e20e54.tar.zst PeerTube-3b20bdd6dc7402b0723e038c57f0606131e20e54.zip |
Servicify menu, close menu on admin for small and medium screens
Diffstat (limited to 'client/src/app/app-routing.module.ts')
-rw-r--r-- | client/src/app/app-routing.module.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/client/src/app/app-routing.module.ts b/client/src/app/app-routing.module.ts index b5a677d15..a87f4ce1b 100644 --- a/client/src/app/app-routing.module.ts +++ b/client/src/app/app-routing.module.ts | |||
@@ -4,10 +4,13 @@ import { RouteReuseStrategy, RouterModule, Routes } from '@angular/router' | |||
4 | import { PreloadSelectedModulesList } from './core' | 4 | import { PreloadSelectedModulesList } from './core' |
5 | import { AppComponent } from '@app/app.component' | 5 | import { AppComponent } from '@app/app.component' |
6 | import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy' | 6 | import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy' |
7 | import { MenuGuards } from '@app/core/routing/menu-guard.service' | ||
7 | 8 | ||
8 | const routes: Routes = [ | 9 | const routes: Routes = [ |
9 | { | 10 | { |
10 | path: 'admin', | 11 | path: 'admin', |
12 | canActivate: [ MenuGuards.close() ], | ||
13 | canDeactivate: [ MenuGuards.open() ], | ||
11 | loadChildren: () => import('./+admin/admin.module').then(m => m.AdminModule) | 14 | loadChildren: () => import('./+admin/admin.module').then(m => m.AdminModule) |
12 | }, | 15 | }, |
13 | { | 16 | { |
@@ -54,6 +57,7 @@ const routes: Routes = [ | |||
54 | }) | 57 | }) |
55 | ], | 58 | ], |
56 | providers: [ | 59 | providers: [ |
60 | MenuGuards.guards, | ||
57 | PreloadSelectedModulesList, | 61 | PreloadSelectedModulesList, |
58 | { provide: RouteReuseStrategy, useClass: CustomReuseStrategy } | 62 | { provide: RouteReuseStrategy, useClass: CustomReuseStrategy } |
59 | ], | 63 | ], |