From bcb0c8958fa624ce815a1e2ba1b0acda0bf6aaa8 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 12 Sep 2018 09:52:08 +0200 Subject: Fix client build --- client/src/app/core/core.module.ts | 14 +++++++++++--- client/src/app/core/hotkeys/hotkeys.component.ts | 2 +- client/src/app/core/hotkeys/hotkeys.module.ts | 23 ----------------------- client/src/app/core/hotkeys/index.ts | 2 +- 4 files changed, 13 insertions(+), 28 deletions(-) delete mode 100644 client/src/app/core/hotkeys/hotkeys.module.ts (limited to 'client/src/app/core') diff --git a/client/src/app/core/core.module.ts b/client/src/app/core/core.module.ts index d4917f902..df2ec696d 100644 --- a/client/src/app/core/core.module.ts +++ b/client/src/app/core/core.module.ts @@ -15,6 +15,8 @@ import { throwIfAlreadyLoaded } from './module-import-guard' import { LoginGuard, RedirectService, UserRightGuard } from './routing' import { ServerService } from './server' import { ThemeService } from './theme' +import { HotkeyModule } from 'angular2-hotkeys' +import { CheatSheetComponent } from '@app/core/hotkeys' @NgModule({ imports: [ @@ -27,11 +29,16 @@ import { ThemeService } from './theme' LoadingBarHttpClientModule, LoadingBarRouterModule, - LoadingBarModule.forRoot() + LoadingBarModule.forRoot(), + + HotkeyModule.forRoot({ + cheatSheetCloseEsc: true + }) ], declarations: [ - ConfirmComponent + ConfirmComponent, + CheatSheetComponent ], exports: [ @@ -39,7 +46,8 @@ import { ThemeService } from './theme' LoadingBarHttpClientModule, LoadingBarModule, - ConfirmComponent + ConfirmComponent, + CheatSheetComponent ], providers: [ diff --git a/client/src/app/core/hotkeys/hotkeys.component.ts b/client/src/app/core/hotkeys/hotkeys.component.ts index f6f299965..fd62289fa 100644 --- a/client/src/app/core/hotkeys/hotkeys.component.ts +++ b/client/src/app/core/hotkeys/hotkeys.component.ts @@ -9,8 +9,8 @@ import { HotkeysService, Hotkey } from 'angular2-hotkeys' styleUrls: [ './hotkeys.component.scss' ] }) export class CheatSheetComponent implements OnInit, OnDestroy { - helpVisible = false @Input() title = this.i18n('Keyboard Shortcuts:') + helpVisible = false subscription: Subscription hotkeys: Hotkey[] diff --git a/client/src/app/core/hotkeys/hotkeys.module.ts b/client/src/app/core/hotkeys/hotkeys.module.ts deleted file mode 100644 index 7d420587e..000000000 --- a/client/src/app/core/hotkeys/hotkeys.module.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { NgModule, ModuleWithProviders } from '@angular/core' -import { CommonModule } from '@angular/common' -import { HotkeysDirective, IHotkeyOptions, HotkeyOptions, HotkeysService } from 'angular2-hotkeys' -import { CheatSheetComponent } from './hotkeys.component' - -export * from './hotkeys.component' - -@NgModule({ - imports : [CommonModule], - exports : [HotkeysDirective, CheatSheetComponent], - declarations : [HotkeysDirective, CheatSheetComponent] -}) -export class HotkeyModule { - static forRoot (options: IHotkeyOptions = {}): ModuleWithProviders { - return { - ngModule : HotkeyModule, - providers : [ - HotkeysService, - { provide : HotkeyOptions, useValue : options } - ] - } - } -} diff --git a/client/src/app/core/hotkeys/index.ts b/client/src/app/core/hotkeys/index.ts index 4f2796766..bd2ab5b7a 100644 --- a/client/src/app/core/hotkeys/index.ts +++ b/client/src/app/core/hotkeys/index.ts @@ -1 +1 @@ -export * from './hotkeys.module' +export * from './hotkeys.component' \ No newline at end of file -- cgit v1.2.3