Remove placeholder in keymap-tab

This commit is contained in:
Farkas József
2016-11-20 21:58:07 +01:00
committed by József Farkas
parent 34eb09ee9c
commit 064d2eb29a
3 changed files with 28 additions and 25 deletions
@@ -1,3 +1,7 @@
<template [ngIf]="keymapOptions.length === 0">
<span> No keymaps are available to choose from. Create a keymap first! </span>
</template>
<template [ngIf]="keymapOptions.length > 0">
<div> <div>
<b>Switch to keymap:</b> <b>Switch to keymap:</b>
<select2 <select2
@@ -15,3 +19,4 @@
[moduleConfig]="selectedKeymap.layers[0].modules"> [moduleConfig]="selectedKeymap.layers[0].modules">
</svg-keyboard> </svg-keyboard>
</div> </div>
</template>
@@ -2,6 +2,10 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
> span {
text-align: center;
}
> div { > div {
display: flex; display: flex;
margin-top: 2px; margin-top: 2px;
@@ -31,15 +31,9 @@ export class KeymapTabComponent implements OnInit, Tab {
text: keymap.name text: keymap.name
}; };
}); });
if (this.keymaps.length > 0) {
this.keymapOptions = [ this.selectedKeymap = this.keymaps[0];
{ }
id: '-1',
text: 'Switch to keymap'
},
...this.keymapOptions
];
this.fromKeyAction(this.defaultKeyAction); this.fromKeyAction(this.defaultKeyAction);
} }