KeyAction Editor Popover first steps.

This commit is contained in:
József Farkas
2016-05-11 22:52:47 +02:00
parent d4ef07a6b0
commit 956f22fc8c
5 changed files with 289 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import {SvgKeyboardKey} from './svg-keyboard-key.model';
import {SvgKeyboardKeyComponent} from './svg-keyboard-key.component';
@@ -15,14 +15,23 @@ import {KeyAction} from '../../config-serializer/config-items/KeyAction';
[width]="key.width" [height]="key.height"
[attr.transform]="'translate(' + key.x + ' ' + key.y + ')'"
[keyAction]="keyActions[i]"
(click)="onKeyClick(i)"
/>
<popover *ngIf="popOverEnabled"></popover>
`,
styles:
[`
:host {
position: relative;
}
`],
directives: [SvgKeyboardKeyComponent]
})
export class SvgModuleComponent implements OnInit {
@Input() coverages: any[];
@Input() keyboardKeys: SvgKeyboardKey[];
@Input() keyActions: KeyAction[];
@Output() editKeyActionRequest = new EventEmitter<number>();
constructor() {
this.keyboardKeys = [];
@@ -30,4 +39,8 @@ export class SvgModuleComponent implements OnInit {
ngOnInit() { }
onKeyClick(index: number): void {
this.editKeyActionRequest.emit(index);
}
}