summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhitya Kamakshidasan2016-07-05 13:03:24 +0530
committerGitHub2016-07-05 13:03:24 +0530
commitfad9e43254ee9ad04d887440fef667d1b3d698c3 (patch)
tree94f774b351f65722d09c32e152b39ecb38885c32
parentf4f4aeccb8cf33bef601bcfa5c9f874c6106d7ce (diff)
parent00d078225041dd1827f98ab5bd480e5d6ead440f (diff)
downloadxcos-on-web-fad9e43254ee9ad04d887440fef667d1b3d698c3.tar.gz
xcos-on-web-fad9e43254ee9ad04d887440fef667d1b3d698c3.tar.bz2
xcos-on-web-fad9e43254ee9ad04d887440fef667d1b3d698c3.zip
Merge pull request #126 from jiteshjha/display-splitblock-over-associated-edges
Display splitblock over its associated edges
-rw-r--r--index.html18
1 files changed, 18 insertions, 0 deletions
diff --git a/index.html b/index.html
index 9e536c4..a7d1a00 100644
--- a/index.html
+++ b/index.html
@@ -329,6 +329,8 @@
// (x-5, y-5.5) is the offset to correct the position of split-block
var cell = graph.insertVertex(graph.getDefaultParent(), null, '', source.sourcePoint.x-5, source.sourcePoint.y-5.5, 10, 10,'Split', false);
+
+
// Get the source state
var sourceState = graph.view.getState(source);
var waypoints = source.waypoints;
@@ -411,6 +413,22 @@
cell.getChildAt(1).setConnectable(false);
cell.getChildAt(2).setConnectable(false);
cell.setConnectable(false);
+
+ // Get the parent of the splitBlock
+ var parent = graph.model.getParent(cell);
+
+ graph.model.beginUpdate();
+ try {
+ /*
+ * Adds the split-block to the parent at the last index
+ * Enables split-block to appear over it's associated edges
+ */
+ graph.model.add(parent, cell, graph.model.getChildCount(parent) - 1);
+ }
+ finally {
+ graph.model.endUpdate();
+ }
+
graph.refresh();
}
finally