This commit is contained in:
Eugene Pankov 2017-05-13 12:33:53 +02:00
parent 6cb5351460
commit 791822be12
3 changed files with 8 additions and 7 deletions

View file

@ -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()',
)

View file

@ -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

View file

@ -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()