Commit d3a35581 authored by Akikonata's avatar Akikonata

recover

parent 459155f6
......@@ -571,13 +571,6 @@ KityMinder.registerModule( "LayoutDefault", function () {
( ( sub_nolimit || ( c.length <= expandoptions.defaultSubShow ) ) && ( layer_nolimit || ( cur_layer <= expand_layer ) ) ) ||
_buffer[ j ].getLayout().expand
) && c.length !== 0 ) {
if ( _buffer[ j ].getLayout().expand ) {
console.log( (
(
( ( sub_nolimit || ( c.length <= expandoptions.defaultSubShow ) ) && ( layer_nolimit || ( cur_layer <= expand_layer ) ) ) ||
_buffer[ j ].getLayout().expand
) && c.length !== 0 ) );
}
this.expandNode( _buffer[ j ] );
_buffer = _buffer.concat( _buffer[ j ].getChildren() );
}
......@@ -587,19 +580,11 @@ KityMinder.registerModule( "LayoutDefault", function () {
_root.setPoint( _root.getLayout().x, _root.getLayout().y );
},
appendChildNode: function ( parent, node, focus, sibling ) {
if ( parent.getType() !== "root" && parent.getChildren().length !== 0 && parent.getLayout().expand === false ) {
minder.expandNode( parent );
}
minder.handelNodeInsert( node );
var Layout = node.getLayout();
var oldExpand;
if ( Layout ) {
oldExpand = Layout.expand;
}
node.clearLayout();
node.getContRc().clear();
Layout = node.getLayout();
Layout.expand = oldExpand || false;
var Layout = node.getLayout();
Layout.expand = false;
if ( parent.getType() !== 'root' ) {
parent.getLayout().expand = true;
}
......
KityMinder.registerModule( "LayoutModule", function () {
var me = this;
var clearPaper = function () {
me._rc.remove();
me._rc = new kity.Group();
me._paper.addShape( this._rc );
};
kity.extendClass( Minder, {
addLayoutStyle: function ( name, style ) {
if ( !this._layoutStyles ) this._layoutStyles = {};
......@@ -40,16 +46,16 @@ KityMinder.registerModule( "LayoutModule", function () {
var _root = this.getRoot();
_root.preTraverse( function ( n ) {
var oldExpand;
if ( n.getLayout() ) {
oldExpand = n.getLayout().expand;
}
n.clearLayout();
n.getLayout().expand = oldExpand;
} );
this.getLayoutStyle( curStyle ).initStyle.call( this, expandall );
this.fire( 'afterinitstyle' );
},
restoreStyle: function () {
var curStyle = this.getCurrentStyle();
clearPaper();
var _root = this.getRoot();
},
appendChildNode: function ( parent, node, focus, index ) {
var curStyle = this.getCurrentStyle();
this.getLayoutStyle( curStyle ).appendChildNode.call( this, parent, node, focus, index );
......@@ -120,7 +126,7 @@ KityMinder.registerModule( "LayoutModule", function () {
if ( !parent ) {
return null;
}
if ( parent.getType() !== "root" && parent.getChildren().length !== 0 && parent.getData( "expand" ) === false ) {
if ( parent.getType() !== "root" && parent.getChildren().length !== 0 && parent.getLayout().expand === false ) {
km.expandNode( parent );
}
......
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