From 791822be129f588fff9af722d128ab6c96894751 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Sat, 13 May 2017 12:33:53 +0200 Subject: [PATCH] . --- terminus-core/src/components/appRoot.component.pug | 4 ++-- terminus-core/src/components/appRoot.component.ts | 9 +++++---- terminus-core/src/services/hotkeys.service.ts | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/terminus-core/src/components/appRoot.component.pug b/terminus-core/src/components/appRoot.component.pug index e451c4ea..9f177282 100644 --- a/terminus-core/src/components/appRoot.component.pug +++ b/terminus-core/src/components/appRoot.component.pug @@ -24,7 +24,7 @@ title-bar( .btn-group button.btn.btn-secondary.btn-tab-bar( - *ngFor='let button of getLeftToolbarButtons()', + *ngFor='let button of leftToolbarButtons', [title]='button.title', (click)='button.click()', ) @@ -34,7 +34,7 @@ title-bar( .btn-group button.btn.btn-secondary.btn-tab-bar( - *ngFor='let button of getRightToolbarButtons()', + *ngFor='let button of rightToolbarButtons', [title]='button.title', (click)='button.click()', ) diff --git a/terminus-core/src/components/appRoot.component.ts b/terminus-core/src/components/appRoot.component.ts index 26a7e18a..38b5c725 100644 --- a/terminus-core/src/components/appRoot.component.ts +++ b/terminus-core/src/components/appRoot.component.ts @@ -44,6 +44,8 @@ export class AppRootComponent { toasterConfig: ToasterConfig Platform = Platform @Input() ready = false + @Input() leftToolbarButtons: IToolbarButton[] + @Input() rightToolbarButtons: IToolbarButton[] private logger: Logger constructor ( @@ -68,6 +70,9 @@ export class AppRootComponent { timeout: 4000, }) + this.leftToolbarButtons = this.getToolbarButtons(false) + this.rightToolbarButtons = this.getToolbarButtons(true) + this.hotkeys.matchedHotkey.subscribe((hotkey) => { if (hotkey.startsWith('tab-')) { let index = parseInt(hotkey.split('-')[1]) @@ -126,10 +131,6 @@ export class AppRootComponent { } } - getLeftToolbarButtons (): IToolbarButton[] { return this.getToolbarButtons(false) } - - getRightToolbarButtons (): IToolbarButton[] { return this.getToolbarButtons(true) } - async ngOnInit () { await this.tabRecovery.recoverTabs() this.ready = true diff --git a/terminus-core/src/services/hotkeys.service.ts b/terminus-core/src/services/hotkeys.service.ts index 1551bea5..2d5eccbc 100644 --- a/terminus-core/src/services/hotkeys.service.ts +++ b/terminus-core/src/services/hotkeys.service.ts @@ -115,7 +115,7 @@ export class HotkeysService { for (let sequence of this.getHotkeysConfig()[id]) { let currentStrokes = this.getCurrentKeystrokes() if (currentStrokes.length < sequence.length) { - break + continue } if (sequence.every((x, index) => { return x.toLowerCase() === currentStrokes[currentStrokes.length - sequence.length + index].toLowerCase()