summaryrefslogtreecommitdiffstats
path: root/sdc-workflow-designer-ui/src
diff options
context:
space:
mode:
Diffstat (limited to 'sdc-workflow-designer-ui/src')
-rw-r--r--sdc-workflow-designer-ui/src/app/components/node/node.component.ts2
-rw-r--r--sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts35
2 files changed, 20 insertions, 17 deletions
diff --git a/sdc-workflow-designer-ui/src/app/components/node/node.component.ts b/sdc-workflow-designer-ui/src/app/components/node/node.component.ts
index e78c6e8c..5fe189db 100644
--- a/sdc-workflow-designer-ui/src/app/components/node/node.component.ts
+++ b/sdc-workflow-designer-ui/src/app/components/node/node.component.ts
@@ -41,7 +41,7 @@ export class NodeComponent implements AfterViewInit, OnDestroy {
ngAfterViewInit(): void {
if(this.last) {
- this.jsPlumbService.initNode('.node');
+ this.jsPlumbService.initNode();
this.jsPlumbService.connectNodes();
}
diff --git a/sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts b/sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts
index dc1d800f..6aa5028a 100644
--- a/sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts
+++ b/sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts
@@ -119,25 +119,28 @@ export class JsPlumbService {
});
}
- public initNode(selectorString: string) {
- const selector = this.jsplumbInstance.getSelector(selectorString);
-
- this.jsplumbInstance.draggable(selector, {
- });
+ public initNode() {
+ this.processService.getProcess().forEach(node => {
+ this.jsplumbInstance.draggable(node.id, {
+ stop: event => {
+ node.position.left = event.pos[0];
+ node.position.top = event.pos[1];
+ },
+ });
- this.jsplumbInstance.makeTarget(selector, {
- detachable: false,
- isTarget: true,
- maxConnections: -1,
- });
+ this.jsplumbInstance.makeTarget(node.id, {
+ detachable: false,
+ isTarget: true,
+ maxConnections: -1,
+ });
- this.jsplumbInstance.makeSource(selector, {
- filter: '.anchor, .anchor *',
- detachable: false,
- isSource: true,
- maxConnections: -1,
+ this.jsplumbInstance.makeSource(node.id, {
+ filter: '.anchor, .anchor *',
+ detachable: false,
+ isSource: true,
+ maxConnections: -1,
+ });
});
-
}
public connectNodes() {