diff options
Diffstat (limited to 'index.html')
-rw-r--r-- | index.html | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -2081,12 +2081,10 @@ var doc = mxUtils.createXmlDocument(); model.beginUpdate(); try { - var label = getImgHTML(name); // Will not exist for all blocks var details_instance = new window[name](); var details = details_instance.define(); var enc = new mxCodec(mxUtils.createXmlDocument()); var node = enc.encode(details); - node.setAttribute('label', label); var temp = enc.encode(parent); node.setAttribute('parent', temp.getAttribute('id')); var i, arr = []; @@ -2129,6 +2127,7 @@ } } v1 = graph.insertVertex(parent, null, node, x, y, 80, 80, name); + // @Chhavi: Additional attribute to store the block's instance v1.blockInstance = createInstanceTag(details_instance); createPorts(graph, v1, inputPorts, controlPorts, outputPorts, commandPorts); @@ -2257,6 +2256,12 @@ var root = req.getDocumentElement(); var dec = new mxCodec(root.ownerDocument); dec.decode(root, graph.stylesheet); + + var style = new Object(); + style[mxConstants.STYLE_IMAGE_WIDTH] = '80'; + style[mxConstants.STYLE_IMAGE_HEIGHT] = '80'; + style['imageAlign'] = 'center'; + graph.getStylesheet().putDefaultVertexStyle(style); }; </script> <!-- |