Commit 6b3a09ca authored by Akikonata's avatar Akikonata

changed

parent 1cb8fe62
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
//默认是全部展开,0表示全部展开 //默认是全部展开,0表示全部展开
, ,
defaultExpand: { defaultExpand: {
defaultLayer: 2, defaultLayer: 3,
defaultSubShow: 5 defaultSubShow: 5
} }
}; };
......
...@@ -544,26 +544,29 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -544,26 +544,29 @@ KityMinder.registerModule( "LayoutDefault", function () {
this.appendChildNode( _root, mains[ i ] ); this.appendChildNode( _root, mains[ i ] );
} }
cur_layer++; cur_layer++;
//创建一级节点的副本 var clonelayer0 = function () {
var _buffer = ( function () {
var items = []; var items = [];
for ( var i = 0; i < mains.length; i++ ) { for ( var i = 0; i < mains.length; i++ ) {
items.push( mains[ i ] ); items.push( mains[ i ] );
} }
return items; return items;
} )(); };
//创建一级节点的副本
var _buffer = clonelayer0();
next = []; next = [];
var layer_nolimit = expandall || ( expand_layer < 1 ) || false; var layer_nolimit = expandall || ( expand_layer < 1 ) || false;
var sub_nolimit = expandall || ( expandoptions.defaultSubShow < 1 ) || false; var sub_nolimit = expandall || ( expandoptions.defaultSubShow < 1 ) || false;
var loopcontinue = function () {
return ( layer_nolimit ? ( _buffer.length !== 0 ) : ( _buffer.length !== 0 && cur_layer < expand_layer ) ); while ( _buffer.length !== 0 ) {
};
while ( loopcontinue() ) {
cur_layer++; cur_layer++;
var layer_len = _buffer.length; var layer_len = _buffer.length;
for ( var j = 0; j < layer_len; j++ ) { for ( var j = 0; j < layer_len; j++ ) {
var c = _buffer[ j ].getChildren(); var c = _buffer[ j ].getChildren();
if ( ( sub_nolimit || ( c.length <= expandoptions.defaultSubShow ) ) && c.length !== 0 ) { if (
(
( ( sub_nolimit || ( c.length <= expandoptions.defaultSubShow ) ) && ( cur_layer <= expand_layer ) ) ||
_buffer[ j ].getLayout().expand
) && c.length !== 0 ) {
this.expandNode( _buffer[ j ] ); this.expandNode( _buffer[ j ] );
_buffer = _buffer.concat( _buffer[ j ].getChildren() ); _buffer = _buffer.concat( _buffer[ j ].getChildren() );
} }
......
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