aboutsummaryrefslogtreecommitdiffstats
path: root/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.ts')
-rw-r--r--sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.ts33
1 files changed, 12 insertions, 21 deletions
diff --git a/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.ts b/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.ts
index 71bf02ab..c204a19b 100644
--- a/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.ts
+++ b/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.ts
@@ -10,10 +10,10 @@
* ZTE - initial API and implementation and/or initial documentation
*/
-import { AfterViewInit, Component, OnInit } from '@angular/core';
+import { AfterViewChecked, Component, OnInit } from '@angular/core';
+import { BroadcastService } from '../../services/broadcast.service';
import { JsPlumbService } from '../../services/jsplumb.service';
-import { NodeType } from "../../model/workflow/node-type.enum";
/**
* toolbar component contains some basic operations(save) and all of the supported workflow nodes.
@@ -24,29 +24,20 @@ import { NodeType } from "../../model/workflow/node-type.enum";
templateUrl: 'toolbar.component.html',
styleUrls: ['./toolbar.component.css']
})
-export class ToolbarComponent implements AfterViewInit, OnInit {
- public nodeTypes = [];
+export class ToolbarComponent implements AfterViewChecked, OnInit {
+ public isCatalog = true;
+ private needInitButton = true;
- constructor(private jsPlumbService: JsPlumbService) {
- }
-
- public ngAfterViewInit() {
- this.jsPlumbService.buttonDraggable();
- }
+ constructor(private jsPlumbService: JsPlumbService, private broadcastService: BroadcastService) { }
- ngOnInit(): void {
- this.getNodeTypes();
+ public ngOnInit() {
}
- private getNodeTypes() {
- for(let key in NodeType) {
- if (typeof NodeType[key] === 'number') {
- this.nodeTypes.push(key);
- }
+ public ngAfterViewChecked() {
+ if (this.needInitButton) {
+ this.jsPlumbService.buttonDraggable();
+ this.jsPlumbService.buttonDroppable();
+ this.needInitButton = false;
}
}
-
- public getNameByType(type:string):string{
- return type.replace(type.charAt(0), type.charAt(0).toUpperCase());
- }
}