Commit bab1929d authored by Akikonata's avatar Akikonata

fixed expand icon

parent 06fe1634
......@@ -82,10 +82,10 @@
//,zIndex : 1000
//设置初始加载时展开的层数和子节点数目阈值
//默认是全部展开,0表示全部展开
// ,
// defaultExpand: {
// defaultLayer: 1,
// defaultSubShow: 5
// }
,
defaultExpand: {
defaultLayer: 1,
defaultSubShow: 5
}
};
} )();
\ No newline at end of file
......@@ -100,10 +100,10 @@ KityMinder.registerModule( "Expand", function () {
return {
'events': {
'importData': function ( e ) {
// var data = e.data;
// console.log( data );
// var options = this.getOptions();
// console.log( options );
var data = e.data;
console.log( data );
var options = this.getOptions();
console.log( options );
}
},
'commands': {}
......
......@@ -545,7 +545,6 @@ KityMinder.registerModule( "LayoutDefault", function () {
var mains = _root.getChildren();
for ( var i = 0; i < mains.length; i++ ) {
this.appendChildNode( _root, mains[ i ] );
console.log( mains[ i ].isExpanded() );
if ( mains[ i ].isExpanded() && mains[ i ].getChildren().length > 0 ) {
minder.expandNode( mains[ i ] );
}
......@@ -569,7 +568,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
while ( _buffer.length !== 0 ) {
var c = _buffer[ 0 ].getChildren();
if ( _buffer[ 0 ].isExpanded() && c.length !== 0 ) {
_buffer[ 0 ].getLayout().shicon.switchState( true );
//_buffer[ 0 ].getLayout().shicon.switchState( true );
for ( var x = 0; x < c.length; x++ ) {
minder.appendChildNode( _buffer[ 0 ], c[ x ] );
}
......@@ -705,6 +704,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
if ( focus ) {
showNodeInView( node );
}
var shicon = parent.getLayout().shicon;
if ( shicon ) shicon.switchState( true );
},
appendSiblingNode: function ( sibling, node, focus ) {
var parent = sibling.getParent();
......
......@@ -129,7 +129,7 @@ KityMinder.registerModule( "LayoutModule", function () {
if ( parent.getType() !== "root" && parent.getChildren().length !== 0 && !parent.isExpanded() ) {
km.expandNode( parent );
}
parent.expand();
km.appendChildNode( parent, node, focus, silbling );
km.select( node, true );
return 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