});\r
}\r
\r
- public initNode(selectorString: string) {\r
- const selector = this.jsplumbInstance.getSelector(selectorString);\r
-\r
- this.jsplumbInstance.draggable(selector, {\r
- });\r
+ public initNode() {\r
+ this.processService.getProcess().forEach(node => {\r
+ this.jsplumbInstance.draggable(node.id, {\r
+ stop: event => {\r
+ node.position.left = event.pos[0];\r
+ node.position.top = event.pos[1];\r
+ },\r
+ });\r
\r
- this.jsplumbInstance.makeTarget(selector, {\r
- detachable: false,\r
- isTarget: true,\r
- maxConnections: -1,\r
- });\r
+ this.jsplumbInstance.makeTarget(node.id, {\r
+ detachable: false,\r
+ isTarget: true,\r
+ maxConnections: -1,\r
+ });\r
\r
- this.jsplumbInstance.makeSource(selector, {\r
- filter: '.anchor, .anchor *',\r
- detachable: false,\r
- isSource: true,\r
- maxConnections: -1,\r
+ this.jsplumbInstance.makeSource(node.id, {\r
+ filter: '.anchor, .anchor *',\r
+ detachable: false,\r
+ isSource: true,\r
+ maxConnections: -1,\r
+ });\r
});\r
-\r
}\r
\r
public connectNodes() {\r