mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-04-23 22:30:37 +00:00
Fix diagram event properties color
This commit is contained in:
@@ -1 +1,2 @@
|
||||
<raphael-circle [center]="center" [radius]="radius" [strokeWith]="strokeWidth"></raphael-circle>
|
||||
<raphael-circle [center]="center" [radius]="data.radius" [strokeWidth]="data.strokeWidth" [stroke]="data.stroke"
|
||||
[fillColors]="data.fillColors" [fillOpacity]="data.fillOpacity"></raphael-circle>
|
||||
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core';
|
||||
import { DiagramColorService } from './services/diagram-color.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
@@ -38,11 +39,18 @@ export class DiagramEventComponent {
|
||||
|
||||
center: any = {};
|
||||
|
||||
constructor(public elementRef: ElementRef) {}
|
||||
constructor(public elementRef: ElementRef,
|
||||
private diagramColorService: DiagramColorService) {}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.elementRef);
|
||||
this.center.x = this.data.x + (this.data.width / 2);
|
||||
this.center.y = this.data.y + (this.data.height / 2);
|
||||
|
||||
this.data.radius = this.radius;
|
||||
this.data.strokeWidth = this.strokeWidth;
|
||||
this.data.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR);
|
||||
this.data.fillColors = this.diagramColorService.getFillColour(this.data.id);
|
||||
this.data.fillOpacity = this.diagramColorService.getFillOpacity();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,16 @@ export class RaphaelCircleDirective extends RaphaelBase implements OnInit {
|
||||
radius: number;
|
||||
|
||||
@Input()
|
||||
strokeWith: number;
|
||||
strokeWidth: number;
|
||||
|
||||
@Input()
|
||||
fillColors: any;
|
||||
|
||||
@Input()
|
||||
stroke: any;
|
||||
|
||||
@Input()
|
||||
fillOpacity: any;
|
||||
|
||||
@Output()
|
||||
onError = new EventEmitter();
|
||||
@@ -44,7 +53,7 @@ export class RaphaelCircleDirective extends RaphaelBase implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.elementRef);
|
||||
let opts = {'stroke-width': this.strokeWith};
|
||||
let opts = {'stroke-width': this.strokeWidth, 'fill': this.fillColors, 'stroke': this.stroke, 'fill-opacity': this.fillOpacity};
|
||||
this.draw(this.center, this.radius, opts);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user