From d9360b2fb73fe6a4d0ba2acc6e6ace7edef94a9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Farkas?= Date: Sat, 16 Apr 2016 14:57:06 +0200 Subject: [PATCH] Move the fill of keys to the root --- src/components/keyboard-key.component.ts | 1 - src/components/keyboard-key.model.ts | 1 - src/components/keyboard.component.ts | 7 ++++--- src/components/module.component.ts | 3 +-- src/components/module.model.ts | 3 +-- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/components/keyboard-key.component.ts b/src/components/keyboard-key.component.ts index efc03b2a..a2e6aad2 100644 --- a/src/components/keyboard-key.component.ts +++ b/src/components/keyboard-key.component.ts @@ -16,7 +16,6 @@ export class KeyboardKeyComponent implements OnInit { @Input() ry: string; @Input() height: string; @Input() width: string; - @Input() fill: string; constructor() { } diff --git a/src/components/keyboard-key.model.ts b/src/components/keyboard-key.model.ts index c4e45ab0..74321cd2 100644 --- a/src/components/keyboard-key.model.ts +++ b/src/components/keyboard-key.model.ts @@ -6,5 +6,4 @@ export interface KeyboardKey { ry: string; height: string; width: string; - fill: string; } diff --git a/src/components/keyboard.component.ts b/src/components/keyboard.component.ts index d79c729e..6b802c13 100644 --- a/src/components/keyboard.component.ts +++ b/src/components/keyboard.component.ts @@ -8,11 +8,10 @@ import {Module, ModuleComponent} from './module'; template: ` - + @@ -33,6 +32,7 @@ export class KeyboardComponent implements OnInit { private modules: Module[]; private svg: any; private transform: string; + private fill: string; constructor(private dps: DataProviderService) { this.modules = []; @@ -42,7 +42,8 @@ export class KeyboardComponent implements OnInit { this.svg = this.dps.getBaseLayer(); this.viewBox = this.svg.$.viewBox; this.transform = this.svg.g[0].$.transform; - this.modules = this.svg.g[0].g.map(obj => new Module(obj, this.svg.g[0].$.fill)); + this.fill = this.svg.g[0].$.fill; + this.modules = this.svg.g[0].g.map(obj => new Module(obj)); } } diff --git a/src/components/module.component.ts b/src/components/module.component.ts index 526c0fc1..d22409ef 100644 --- a/src/components/module.component.ts +++ b/src/components/module.component.ts @@ -9,7 +9,7 @@ import {KeyboardKeyComponent} from './keyboard-key.component'; ` rect.$); - this.keyboardKeys.forEach(keyboardKey => keyboardKey.fill = fill ? fill : 'black'); this.coverages = obj.path; this.attributes = obj.$; }