aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/menu/menu.component.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2018-09-26 14:23:10 +0200
committerRigel Kent <sendmemail@rigelk.eu>2018-09-26 14:23:19 +0200
commit4a216666e7f353e638c6927a9ff0c8fce4e94014 (patch)
tree161bbc26b02de636bae4977bcd169d142c056484 /client/src/app/menu/menu.component.ts
parent2e7cf5ae0cf8fbc9526742b67a0079d42211644c (diff)
downloadPeerTube-4a216666e7f353e638c6927a9ff0c8fce4e94014.tar.gz
PeerTube-4a216666e7f353e638c6927a9ff0c8fce4e94014.tar.zst
PeerTube-4a216666e7f353e638c6927a9ff0c8fce4e94014.zip
add shortcuts icon in menu
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 }