diff --git a/src/components/popover/tab/keymap/keymap-tab.component.html b/src/components/popover/tab/keymap/keymap-tab.component.html
index 70661a74..a7bc1500 100644
--- a/src/components/popover/tab/keymap/keymap-tab.component.html
+++ b/src/components/popover/tab/keymap/keymap-tab.component.html
@@ -12,6 +12,6 @@
+ [moduleConfig]="selectedKeymap.layers[0].modules.elements">
\ No newline at end of file
diff --git a/src/components/svg/wrap/svg-keyboard-wrap.component.ts b/src/components/svg/wrap/svg-keyboard-wrap.component.ts
index 97341381..55bcd327 100644
--- a/src/components/svg/wrap/svg-keyboard-wrap.component.ts
+++ b/src/components/svg/wrap/svg-keyboard-wrap.component.ts
@@ -117,7 +117,7 @@ export class SvgKeyboardWrapComponent implements OnChanges {
ngOnChanges(changes: SimpleChanges) {
if (changes['keymap'].previousValue.abbreviation !== changes['keymap'].currentValue.abbreviation) {
- this.layers = this.keymap.layers.elements;
+ this.layers = this.keymap.layers;
this.currentLayer = 0;
if (this.layers.length > 0) {
diff --git a/src/config-serializer/config-items/Keymap.ts b/src/config-serializer/config-items/Keymap.ts
index 6b39e74d..88a35fab 100644
--- a/src/config-serializer/config-items/Keymap.ts
+++ b/src/config-serializer/config-items/Keymap.ts
@@ -1,6 +1,6 @@
import { Serializable } from '../Serializable';
import { UhkBuffer } from '../UhkBuffer';
-import { Layers } from './Layers';
+import { Layer } from './Layer';
export class Keymap extends Serializable {
@@ -12,7 +12,7 @@ export class Keymap extends Serializable {
isDefault: boolean;
- layers: Layers;
+ layers: Layer[];
constructor(keymap?: Keymap) {
super();
@@ -24,7 +24,7 @@ export class Keymap extends Serializable {
this.description = keymap.description;
this.abbreviation = keymap.abbreviation;
this.isDefault = keymap.isDefault;
- this.layers = new Layers(keymap.layers);
+ this.layers = keymap.layers.map(layer => new Layer(layer));
}
_fromJsObject(jsObject: any): Keymap {
@@ -32,7 +32,7 @@ export class Keymap extends Serializable {
this.abbreviation = jsObject.abbreviation;
this.name = jsObject.name;
this.description = jsObject.description;
- this.layers = new Layers().fromJsObject(jsObject.layers);
+ this.layers = jsObject.layers.map((layer: any) => new Layer().fromJsObject(layer));
return this;
}
@@ -41,7 +41,7 @@ export class Keymap extends Serializable {
this.abbreviation = buffer.readString();
this.name = buffer.readString();
this.description = buffer.readString();
- this.layers = new Layers().fromBinary(buffer);
+ this.layers = buffer.readArray(Layer);
return this;
}
@@ -51,7 +51,7 @@ export class Keymap extends Serializable {
abbreviation: this.abbreviation,
name: this.name,
description: this.description,
- layers: this.layers.toJsObject()
+ layers: this.layers.map(layer => layer.toJsObject())
};
}
@@ -60,7 +60,7 @@ export class Keymap extends Serializable {
buffer.writeString(this.abbreviation);
buffer.writeString(this.name);
buffer.writeString(this.description);
- this.layers.toBinary(buffer);
+ buffer.writeArray(this.layers);
}
toString(): string {