Keymap-tab minor fixes

Remove empty inner style
Move keymaps (real) initialization from constructor to ngOnInit
This commit is contained in:
József Farkas
2016-06-02 19:09:23 +02:00
parent 0dd6aad3e7
commit 3bc4a1c795

View File

@@ -12,7 +12,7 @@ import {SwitchKeymapAction} from '../../../../config-serializer/config-items/Swi
template: template:
` `
<div> <div>
<b style="">Switch to keymap:</b> <b>Switch to keymap:</b>
<select class="layout-switcher" [(ngModel)]="selectedKeymapIndex"> <select class="layout-switcher" [(ngModel)]="selectedKeymapIndex">
<option [ngValue]="-1"> Select keymap </option> <option [ngValue]="-1"> Select keymap </option>
<option *ngFor="let keymap of keymaps; let index=index" [ngValue]="index"> {{ keymap.name }} </option> <option *ngFor="let keymap of keymaps; let index=index" [ngValue]="index"> {{ keymap.name }} </option>
@@ -35,12 +35,14 @@ export class KeymapTabComponent implements OnInit, KeyActionSaver {
private keymaps: Keymap[]; private keymaps: Keymap[];
private selectedKeymapIndex: number; private selectedKeymapIndex: number;
constructor(uhkConfigurationService: UhkConfigurationService) { constructor(private uhkConfigurationService: UhkConfigurationService) {
this.selectedKeymapIndex = -1; this.selectedKeymapIndex = -1;
this.keymaps = uhkConfigurationService.getUhkConfiguration().keymaps.elements; this.keymaps = [];
} }
ngOnInit() { } ngOnInit() {
this.keymaps = this.uhkConfigurationService.getUhkConfiguration().keymaps.elements;
}
keyActionValid(): boolean { keyActionValid(): boolean {
return this.selectedKeymapIndex !== -1; return this.selectedKeymapIndex !== -1;