Commit bab1929d authored by Akikonata's avatar Akikonata

fixed expand icon

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