Remapping: Popover tabs initialization accordance with the key action
This commit is contained in:
@@ -124,6 +124,8 @@ export class SvgKeyboardKeyComponent implements OnInit, OnChanges {
|
||||
break;
|
||||
}
|
||||
this.labelSource = newLabelSource;
|
||||
} else {
|
||||
this.labelSource = undefined;
|
||||
}
|
||||
} else if (this.keyAction instanceof SwitchLayerAction) {
|
||||
let keyAction: SwitchLayerAction = this.keyAction as SwitchLayerAction;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<svg-keyboard [moduleConfig]="moduleConfig"
|
||||
(keyClick)="onKeyClick($event.moduleId, $event.keyId)">
|
||||
</svg-keyboard>
|
||||
<popover *ngIf="popoverEnabled" (cancel)="hidePopover()" (remap)="onRemap($event)"></popover>
|
||||
<popover *ngIf="popoverEnabled" [defaultKeyAction]="popoverInitKeyAction" (cancel)="hidePopover()" (remap)="onRemap($event)"></popover>
|
||||
|
Before Width: | Height: | Size: 221 B After Width: | Height: | Size: 263 B |
@@ -16,6 +16,7 @@ export class SvgKeyboardPopoverComponent implements OnInit {
|
||||
|
||||
private popoverEnabled: boolean;
|
||||
private keyEditConfig: { moduleId: number, keyId: number };
|
||||
private popoverInitKeyAction: KeyAction;
|
||||
|
||||
constructor() {
|
||||
this.keyEditConfig = {
|
||||
@@ -32,7 +33,9 @@ export class SvgKeyboardPopoverComponent implements OnInit {
|
||||
moduleId,
|
||||
keyId
|
||||
};
|
||||
this.showPopover();
|
||||
|
||||
let keyActionToEdit: KeyAction = this.moduleConfig[moduleId].keyActions.elements[keyId];
|
||||
this.showPopover(keyActionToEdit);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,12 +44,14 @@ export class SvgKeyboardPopoverComponent implements OnInit {
|
||||
this.hidePopover();
|
||||
}
|
||||
|
||||
showPopover(): void {
|
||||
showPopover(keyAction?: KeyAction): void {
|
||||
this.popoverInitKeyAction = keyAction;
|
||||
this.popoverEnabled = true;
|
||||
}
|
||||
|
||||
hidePopover(): void {
|
||||
this.popoverEnabled = false;
|
||||
this.popoverInitKeyAction = undefined;
|
||||
}
|
||||
|
||||
changeKeyAction(keyAction: KeyAction): void {
|
||||
|
||||
Reference in New Issue
Block a user