Eugene Pankov %!s(int64=8) %!d(string=hai) anos
pai
achega
791822be12

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

+ 5 - 4
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

+ 1 - 1
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()