Commit 981e1fec authored by campaign's avatar campaign

Merge remote-tracking branch 'origin/dev' into dev

parents 90a6da8d 97a03b73
...@@ -81,9 +81,9 @@ ...@@ -81,9 +81,9 @@
//设置km整体的z-index大小 //设置km整体的z-index大小
//,zIndex : 1000 //,zIndex : 1000
//设置初始加载时展开的层数和子节点数目阈值 //设置初始加载时展开的层数和子节点数目阈值
//,expand: { //,defaultExpand: {
//layer: 0, //defaultLayer: 0,
//sub: 0 //defaultSubShow: 0
//} //}
}; };
} )(); } )();
\ No newline at end of file
...@@ -33,7 +33,6 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -33,7 +33,6 @@ KityMinder.registerModule( "LayoutDefault", function () {
minder.getRenderContainer().addShape( iconShape ); minder.getRenderContainer().addShape( iconShape );
iconShape.addShapes( [ circle, plus, dec ] ); iconShape.addShapes( [ circle, plus, dec ] );
this.update(); this.update();
//this.switchState();
}, },
switchState: function () { switchState: function () {
if ( !this._show ) { if ( !this._show ) {
...@@ -537,9 +536,9 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -537,9 +536,9 @@ KityMinder.registerModule( "LayoutDefault", function () {
updateLayoutVertical( _root ); updateLayoutVertical( _root );
translateNode( _root ); translateNode( _root );
if ( historyPoint ) _root.setPoint( historyPoint.x, historyPoint.y ); if ( historyPoint ) _root.setPoint( historyPoint.x, historyPoint.y );
var expandoptions = minder.getOptions( 'expand' ); var expandoptions = minder.getOptions( 'defaultExpand' );
var cur_layer = 0; var cur_layer = 0;
var expand_layer = expandoptions.layer; var expand_layer = expandoptions.defaultLayer;
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 ] );
...@@ -554,9 +553,8 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -554,9 +553,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
return items; return items;
} )(); } )();
next = []; next = [];
var layer_nolimit = ( expand_layer < 1 ) || ( !expand_layer ) || false; var layer_nolimit = ( expand_layer < 1 ) || ( !expand_layer ) || false;
//debugger; var sub_nolimit = ( expandoptions.defaultSubShow < 1 ) || false;
var sub_nolimit = ( expandoptions.sub < 0 ) || false;
var loopcontinue = function () { var loopcontinue = function () {
return ( layer_nolimit ? ( _buffer.length !== 0 ) : ( _buffer.length !== 0 && cur_layer < expand_layer ) ); return ( layer_nolimit ? ( _buffer.length !== 0 ) : ( _buffer.length !== 0 && cur_layer < expand_layer ) );
}; };
...@@ -565,7 +563,7 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -565,7 +563,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
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.sub ) ) && c.length !== 0 ) { if ( ( sub_nolimit || ( c.length <= expandoptions.defaultSubShow ) ) && c.length !== 0 ) {
this.expandNode( _buffer[ j ] ); this.expandNode( _buffer[ j ] );
_buffer = _buffer.concat( _buffer[ j ].getChildren() ); _buffer = _buffer.concat( _buffer[ j ].getChildren() );
} }
......
...@@ -251,10 +251,10 @@ KityMinder.registerModule( "LayoutModule", function () { ...@@ -251,10 +251,10 @@ KityMinder.registerModule( "LayoutModule", function () {
'appendchildnode': 'appendchildnode', 'appendchildnode': 'appendchildnode',
'removenode': 'removenode' 'removenode': 'removenode'
}, },
expand:{ 'defaultExpand': {
layer:0, 'defaultLayer': 0,
sub:0 'defaultSubShow': 0
} }
} }
}; };
} ); } );
\ No newline at end of file
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