Commit 33e58298 authored by Akikonata's avatar Akikonata

changed expand into layout

parent b6898c89
...@@ -423,7 +423,7 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -423,7 +423,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
if ( nodeType !== "root" && node.getChildren().length !== 0 ) { if ( nodeType !== "root" && node.getChildren().length !== 0 ) {
if ( !Layout.shicon ) { if ( !Layout.shicon ) {
Layout.shicon = new ShIcon( node ); Layout.shicon = new ShIcon( node );
if ( node.getData( 'expand' ) ) { if ( Layout.expand ) {
Layout.shicon.switchState(); Layout.shicon.switchState();
} }
} }
...@@ -555,7 +555,6 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -555,7 +555,6 @@ KityMinder.registerModule( "LayoutDefault", function () {
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;
debugger;
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 ) );
}; };
...@@ -574,17 +573,17 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -574,17 +573,17 @@ KityMinder.registerModule( "LayoutDefault", function () {
_root.setPoint( _root.getLayout().x, _root.getLayout().y ); _root.setPoint( _root.getLayout().x, _root.getLayout().y );
}, },
appendChildNode: function ( parent, node, focus, sibling ) { appendChildNode: function ( parent, node, focus, sibling ) {
if ( parent.getType() !== "root" && parent.getChildren().length !== 0 && parent.getData( "expand" ) === false ) { if ( parent.getType() !== "root" && parent.getChildren().length !== 0 && parent.getLayout().expand === false ) {
minder.expandNode( parent ); minder.expandNode( parent );
} }
minder.handelNodeInsert( node ); minder.handelNodeInsert( node );
node.clearLayout(); node.clearLayout();
node.getContRc().clear(); node.getContRc().clear();
node.setData( 'expand', false ); var Layout = node.getLayout();
Layout.expand = false;
if ( parent.getType() !== 'root' ) { if ( parent.getType() !== 'root' ) {
parent.setData( 'expand', true ); parent.getLayout().expand = true;
} }
var Layout = node.getLayout();
Layout.added = true; Layout.added = true;
var parentLayout = parent.getLayout(); var parentLayout = parent.getLayout();
var children = parent.getChildren(); var children = parent.getChildren();
...@@ -740,7 +739,8 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -740,7 +739,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
isExpand = ico.icon.switchState(); isExpand = ico.icon.switchState();
node = ico.icon._node; node = ico.icon._node;
} }
node.setData( "expand", isExpand ); var Layout = node.getLayout();
Layout.expand = isExpand;
var _buffer = node.getChildren(); var _buffer = node.getChildren();
if ( isExpand ) { if ( isExpand ) {
for ( var j = 0; j < _buffer.length; j++ ) { for ( var j = 0; j < _buffer.length; j++ ) {
......
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