Commit 5427c7b0 authored by campaign's avatar campaign

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

parents be565a30 d3a35581
......@@ -510,7 +510,6 @@ KityMinder.registerModule( "LayoutDefault", function () {
},
initStyle: function ( expandall ) {
var _root = minder.getRoot();
//debugger;
var historyPoint = _root.getPoint();
if ( historyPoint ) historyPoint = JSON.parse( JSON.stringify( historyPoint ) );
minder.handelNodeInsert( _root );
......@@ -581,22 +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;
}
if ( oldExpand ) {
alert( 'aru' );
}
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 = {};
......@@ -45,6 +51,11 @@ KityMinder.registerModule( "LayoutModule", function () {
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 );
......@@ -115,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 );
}
......@@ -251,12 +262,7 @@ KityMinder.registerModule( "LayoutModule", function () {
"cloneNode": function ( e ) {
var target = e.targetNode;
var source = e.sourceNode;
target.clearLayout();
var sourceLayout = source.getLayout();
var targetLayout = target.getLayout();
targetLayout.expand = utils.clone(sourceLayout.expand);
console.log( targetLayout );
target._layout = utils.extend( {}, source._layout );
}
},
'contextmenu': [ {
......
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