diff options
author | 2017-09-11 19:05:45 +0800 | |
---|---|---|
committer | 2017-09-11 19:05:45 +0800 | |
commit | b4e2f2d1505a3a9ae8b474b8eea271730a2db2ce (patch) | |
tree | cba7e01f526dae0a8fdc944365a37b08774f0f5f /sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts | |
parent | 68cb7b98a377b8de053817c386095006c0793569 (diff) |
save new position after node dragged
save the new position after a node was dragged.
Issue-ID: SDC-308
Change-Id: I647d9fc176d2495eb4031fa1c040cd379ade1156
Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts')
-rw-r--r-- | sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts | 35 |
1 files changed, 19 insertions, 16 deletions
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() {
|