diff options
author | jiteshjha | 2016-07-05 12:51:35 +0530 |
---|---|---|
committer | jiteshjha | 2016-07-05 12:51:35 +0530 |
commit | 00d078225041dd1827f98ab5bd480e5d6ead440f (patch) | |
tree | 9bc994c8ef82eb91f4b81bc1aff98e7a4adcc2d1 | |
parent | 81da447552fea9d334a8f53f44dfae461074dbb8 (diff) | |
download | xcos-on-web-00d078225041dd1827f98ab5bd480e5d6ead440f.tar.gz xcos-on-web-00d078225041dd1827f98ab5bd480e5d6ead440f.tar.bz2 xcos-on-web-00d078225041dd1827f98ab5bd480e5d6ead440f.zip |
Added code now displays splitblock over its associated edges
-rw-r--r-- | index.html | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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 |