Commit 09315d6f authored by Akikonata's avatar Akikonata

added value setting

parent a0ecff6d
...@@ -47,8 +47,7 @@ KityMinder.registerModule( "Expand", function () { ...@@ -47,8 +47,7 @@ KityMinder.registerModule( "Expand", function () {
node.setData( EXPAND_STATE_DATA, STATE_COLLAPSE ); node.setData( EXPAND_STATE_DATA, STATE_COLLAPSE );
}, },
isExpanded: function () { isExpanded: function () {
//return this.getData( EXPAND_STATE_DATA ) === STATE_EXPAND; return this.getData( EXPAND_STATE_DATA ) === STATE_EXPAND;
return true;
} }
} ); } );
return { return {
......
...@@ -562,6 +562,7 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -562,6 +562,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
} }
var _buffer; var _buffer;
if ( isExpand ) { if ( isExpand ) {
node.expand();
//遍历子树展开需要展开的节点 //遍历子树展开需要展开的节点
_buffer = [ node ]; _buffer = [ node ];
debugger; debugger;
...@@ -576,6 +577,7 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -576,6 +577,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
_buffer.shift(); _buffer.shift();
} }
} else { } else {
node.collapse();
//遍历子树移除需要移除的节点 //遍历子树移除需要移除的节点
_buffer = node.getChildren(); _buffer = node.getChildren();
while ( _buffer.length !== 0 ) { while ( _buffer.length !== 0 ) {
...@@ -595,31 +597,6 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -595,31 +597,6 @@ KityMinder.registerModule( "LayoutDefault", function () {
updateConnectAndshIcon( set[ i ] ); updateConnectAndshIcon( set[ i ] );
} }
} }
// var _buffer = node.getChildren();
// if ( isExpand ) {
// for ( var j = 0; j < _buffer.length; j++ ) {
// minder.appendChildNode( node, _buffer[ j ] );
// }
// } else {
// var _buffer = node.getChildren();
// while ( _buffer.length !== 0 ) {
// var Layout = _buffer[ 0 ].getLayout();
// if ( Layout.added ) {
// Layout.added = false;
// _buffer[ 0 ].getRenderContainer().remove();
// Layout.connect.remove();
// if ( Layout.shicon ) Layout.shicon.remove();
// }
// _buffer = _buffer.concat( _buffer[ 0 ].getChildren() );
// _buffer.shift();
// }
// }
// var set = [];
// if ( !isExpand ) set = updateLayoutVertical( node, node.getParent(), "contract" );
// for ( var i = 0; i < set.length; i++ ) {
// translateNode( set[ i ] );
// updateConnectAndshIcon( set[ i ] );
// }
}, },
appendChildNode: function ( parent, node, focus, sibling ) { appendChildNode: function ( parent, node, focus, sibling ) {
minder.handelNodeInsert( node ); minder.handelNodeInsert( 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