summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorjiteshjha2016-07-06 12:37:48 +0530
committerjiteshjha2016-07-06 12:37:48 +0530
commitc9d07007e241508b3cdbb589bf074340afb05a38 (patch)
treef36add3c1d5f3d56553e862e89d37b227923ed58 /index.html
parentbc299f262fb670ea107f3712f5dc33c6640099b1 (diff)
downloadxcos-on-web-c9d07007e241508b3cdbb589bf074340afb05a38.tar.gz
xcos-on-web-c9d07007e241508b3cdbb589bf074340afb05a38.tar.bz2
xcos-on-web-c9d07007e241508b3cdbb589bf074340afb05a38.zip
Fixed source to target order for all port to port edges
Diffstat (limited to 'index.html')
-rw-r--r--index.html18
1 files changed, 18 insertions, 0 deletions
diff --git a/index.html b/index.html
index fc83c08..9c1cedb 100644
--- a/index.html
+++ b/index.html
@@ -609,6 +609,24 @@
alert("Control port must be connected to command port");
}
else {
+
+ if((source.value.indexOf('Input') != -1 && target.value.indexOf('Output') != -1)
+ || (target.value == 'CommandPort' && source.value == 'ControlPort')) {
+ console.log('sdsd');
+ graph.getModel().beginUpdate();
+ try {
+ var newEdge = graph.insertEdge(parent, null, '', target, source);
+ var waypoints = edgeState.absolutePoints;
+ waypoints.reverse();
+ newEdge.geometry.points = waypoints;
+ }
+ finally {
+ graph.getModel().endUpdate();
+ }
+
+ return null;
+ console.log('dsd');
+ }
// If the edge is legit, return the edge.
return mxGraph.prototype.addEdge.apply(this, arguments);
}