Commit de89ff45 authored by Akikonata's avatar Akikonata

added string support

parent ce3a6504
KityMinder.registerModule( "LayoutModule", function () { KityMinder.registerModule( "LayoutModule", function () {
var CreateChildNodeCommand = kity.createClass( "CreateChildNodeCommand", ( function () { var CreateChildNodeCommand = kity.createClass( "CreateChildNodeCommand", ( function () {
return { return {
base: Command, base: Command,
execute: function ( km, parent ) { execute: function ( km, parent ) {
var _node = new MinderNode(); var _node = new MinderNode();
var _nodeD = { var _nodeD = {
text: "New Node", text: "New Node",
x: parent.getData( "data" ).x + 200, x: parent.getData( "data" ).x + 200,
y: Math.random() * 300 + 100, y: Math.random() * 300 + 100,
align: "left" align: "left"
}; };
_node.setData( "data", _nodeD ); switch ( parent.branchside ) {
parent.insertChild( _node ); case "left":
km.execCommand( 'rendernode', _node ); break;
return _node; case "right":
break;
default:
if ( parent ) {} else {}
break;
}
}
_node.setData( "data", _nodeD );
parent.insertChild( _node );
km.execCommand( 'rendernode', _node );
return _node;
}
} }
} } )() );
} )() );
var CreateSiblingNodeCommand = kity.createClass( "CreateSiblingNodeCommand", ( function () { var CreateSiblingNodeCommand = kity.createClass( "CreateSiblingNodeCommand", ( function () {
return { return {
......
...@@ -75,7 +75,13 @@ KityMinder.registerModule( "RenderModule", function () { ...@@ -75,7 +75,13 @@ KityMinder.registerModule( "RenderModule", function () {
return { return {
base: Command, base: Command,
execute: function ( km, node ) { execute: function ( km, node ) {
renderNode( km, node ); if ( node.length ) {
for ( var i = 0; i < node.length; i++ ) {
renderNode( km, node );
}
} else {
renderNode( km, node );
}
} }
}; };
} )() ); } )() );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment