aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/menu/menu.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/menu/menu.component.ts')
-rw-r--r--client/src/app/menu/menu.component.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/client/src/app/menu/menu.component.ts b/client/src/app/menu/menu.component.ts
index f13ecc2c7..9b3608b15 100644
--- a/client/src/app/menu/menu.component.ts
+++ b/client/src/app/menu/menu.component.ts
@@ -3,6 +3,7 @@ import { UserRight } from '../../../../shared/models/users/user-right.enum'
3import { AuthService, AuthStatus, RedirectService, ServerService, ThemeService } from '../core' 3import { AuthService, AuthStatus, RedirectService, ServerService, ThemeService } from '../core'
4import { User } from '../shared/users/user.model' 4import { User } from '../shared/users/user.model'
5import { LanguageChooserComponent } from '@app/menu/language-chooser.component' 5import { LanguageChooserComponent } from '@app/menu/language-chooser.component'
6import { HotkeysService } from 'angular2-hotkeys'
6 7
7@Component({ 8@Component({
8 selector: 'my-menu', 9 selector: 'my-menu',
@@ -15,6 +16,7 @@ export class MenuComponent implements OnInit {
15 user: User 16 user: User
16 isLoggedIn: boolean 17 isLoggedIn: boolean
17 userHasAdminAccess = false 18 userHasAdminAccess = false
19 helpVisible = false
18 20
19 private routesPerRight = { 21 private routesPerRight = {
20 [UserRight.MANAGE_USERS]: '/admin/users', 22 [UserRight.MANAGE_USERS]: '/admin/users',
@@ -29,7 +31,8 @@ export class MenuComponent implements OnInit {
29 private authService: AuthService, 31 private authService: AuthService,
30 private serverService: ServerService, 32 private serverService: ServerService,
31 private redirectService: RedirectService, 33 private redirectService: RedirectService,
32 private themeService: ThemeService 34 private themeService: ThemeService,
35 private hotkeysService: HotkeysService
33 ) {} 36 ) {}
34 37
35 ngOnInit () { 38 ngOnInit () {
@@ -54,6 +57,10 @@ export class MenuComponent implements OnInit {
54 } 57 }
55 } 58 }
56 ) 59 )
60
61 this.hotkeysService.cheatSheetToggle.subscribe(isOpen => {
62 this.helpVisible = isOpen
63 })
57 } 64 }
58 65
59 isRegistrationAllowed () { 66 isRegistrationAllowed () {
@@ -101,6 +108,10 @@ export class MenuComponent implements OnInit {
101 this.languageChooserModal.show() 108 this.languageChooserModal.show()
102 } 109 }
103 110
111 openHotkeysCheatSheet () {
112 this.hotkeysService.cheatSheetToggle.next(!this.helpVisible)
113 }
114
104 toggleDarkTheme () { 115 toggleDarkTheme () {
105 this.themeService.toggleDarkTheme() 116 this.themeService.toggleDarkTheme()
106 } 117 }