Commit de89ff45 authored by Akikonata's avatar Akikonata

added string support

parent ce3a6504
KityMinder.registerModule( "LayoutModule", function () {
var CreateChildNodeCommand = kity.createClass( "CreateChildNodeCommand", ( function () {
return {
base: Command,
execute: function ( km, parent ) {
var _node = new MinderNode();
var _nodeD = {
text: "New Node",
x: parent.getData( "data" ).x + 200,
y: Math.random() * 300 + 100,
align: "left"
};
_node.setData( "data", _nodeD );
parent.insertChild( _node );
km.execCommand( 'rendernode', _node );
return _node;
var CreateChildNodeCommand = kity.createClass( "CreateChildNodeCommand", ( function () {
return {
base: Command,
execute: function ( km, parent ) {
var _node = new MinderNode();
var _nodeD = {
text: "New Node",
x: parent.getData( "data" ).x + 200,
y: Math.random() * 300 + 100,
align: "left"
};
switch ( parent.branchside ) {
case "left":
break;
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 () {
return {
......
......@@ -75,7 +75,13 @@ KityMinder.registerModule( "RenderModule", function () {
return {
base: Command,
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