X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fcore%2Fhotkeys%2Fhotkeys.component.ts;h=60b7516aac7d08e0e64da36681c94d13def96f11;hb=a9816e189ac8f2a078e480b9db9e3e0e9e9b2b53;hp=fd62289fa256ea54e342554b9caa1777eb22f890;hpb=bcb0c8958fa624ce815a1e2ba1b0acda0bf6aaa8;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/core/hotkeys/hotkeys.component.ts b/client/src/app/core/hotkeys/hotkeys.component.ts index fd62289fa..60b7516aa 100644 --- a/client/src/app/core/hotkeys/hotkeys.component.ts +++ b/client/src/app/core/hotkeys/hotkeys.component.ts @@ -1,23 +1,21 @@ -import { Component, OnInit, OnDestroy, Input } from '@angular/core' +import { Hotkey, HotkeysService } from 'angular2-hotkeys' import { Subscription } from 'rxjs' -import { I18n } from '@ngx-translate/i18n-polyfill' -import { HotkeysService, Hotkey } from 'angular2-hotkeys' +import { Component, Input, OnDestroy, OnInit } from '@angular/core' @Component({ - selector : 'my-hotkeys-cheatsheet', - templateUrl : './hotkeys.component.html', + selector: 'my-hotkeys-cheatsheet', + templateUrl: './hotkeys.component.html', styleUrls: [ './hotkeys.component.scss' ] }) export class CheatSheetComponent implements OnInit, OnDestroy { - @Input() title = this.i18n('Keyboard Shortcuts:') + @Input() title = $localize`Keyboard Shortcuts:` helpVisible = false subscription: Subscription hotkeys: Hotkey[] constructor ( - private hotkeysService: HotkeysService, - private i18n: I18n + private hotkeysService: HotkeysService ) {} public ngOnInit (): void { @@ -29,7 +27,7 @@ export class CheatSheetComponent implements OnInit, OnDestroy { if (isOpen === false) { this.helpVisible = false } else { - this.toggleCheatSheet() + this.toggleHelpVisible() } }) } @@ -41,6 +39,10 @@ export class CheatSheetComponent implements OnInit, OnDestroy { } public toggleCheatSheet (): void { + this.hotkeysService.cheatSheetToggle.next(!this.helpVisible) + } + + public toggleHelpVisible (): void { this.helpVisible = !this.helpVisible } }