Commit c658355d authored by Akikonata's avatar Akikonata

test

parent c3581375
...@@ -224,7 +224,7 @@ KityMinder.registerModule( "LayoutBottom", function () { ...@@ -224,7 +224,7 @@ KityMinder.registerModule( "LayoutBottom", function () {
return ( selfWidth > childWidth ? selfWidth : childWidth ); return ( selfWidth > childWidth ? selfWidth : childWidth );
}; };
if ( nodeType === "root" ) { if ( nodeType === "root" ) {
Layout.x = getMinderSize().width / 2; Layout.x = getMinderSize().width / 2 - node.getRenderContainer().getWidth() / 2;
effectSet.push( node ); effectSet.push( node );
} else { } else {
if ( action === "append" || action === "contract" ) { if ( action === "append" || action === "contract" ) {
...@@ -427,6 +427,8 @@ KityMinder.registerModule( "LayoutBottom", function () { ...@@ -427,6 +427,8 @@ KityMinder.registerModule( "LayoutBottom", function () {
} }
}, },
appendChildNode: function ( parent, node, sibling ) { appendChildNode: function ( parent, node, sibling ) {
minder.handelNodeInsert( node );
node.clearLayout();
//设置分支类型 //设置分支类型
if ( parent.getType() === "root" ) { if ( parent.getType() === "root" ) {
node.setType( "main" ); node.setType( "main" );
...@@ -443,8 +445,8 @@ KityMinder.registerModule( "LayoutBottom", function () { ...@@ -443,8 +445,8 @@ KityMinder.registerModule( "LayoutBottom", function () {
node: node node: node
}, false ) ); }, false ) );
updateShapeByCont( node ); updateShapeByCont( node );
var set1 = updateLayoutVertical( node, parent, "append" ); var set2 = updateLayoutHorizon( node, parent, "append" );
var set2 = updateLayoutHorizon( node ); var set1 = updateLayoutVertical( node );
var set = uSet( set1, set2 ); var set = uSet( set1, set2 );
for ( var i = 0; i < set.length; i++ ) { for ( var i = 0; i < set.length; i++ ) {
translateNode( set[ i ] ); translateNode( set[ i ] );
......
...@@ -53,9 +53,10 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -53,9 +53,10 @@ KityMinder.registerModule( "LayoutDefault", function () {
var nodeShape = node.getRenderContainer(); var nodeShape = node.getRenderContainer();
var nodeX, nodeY = ( node.getType() === "main" ? Layout.y : ( Layout.y + nodeShape.getHeight() / 2 - 5 ) ); var nodeX, nodeY = ( node.getType() === "main" ? Layout.y : ( Layout.y + nodeShape.getHeight() / 2 - 5 ) );
if ( Layout.appendside === "left" ) { if ( Layout.appendside === "left" ) {
nodeX = nodeShape.getRenderBox().closurePoints[ 1 ].x - 6; nodeX = nodeShape.getRenderBox().closurePoints[ 1 ].x - 5;
} else { } else {
nodeX = nodeShape.getRenderBox().closurePoints[ 0 ].x + 6; nodeX = nodeShape.getRenderBox().closurePoints[ 0 ].x + 6;
if ( node.getType() === "main" ) nodeX -= 3;
} }
this.shape.setTransform( new kity.Matrix().translate( nodeX, nodeY ) ); this.shape.setTransform( new kity.Matrix().translate( nodeX, nodeY ) );
}, },
...@@ -340,7 +341,7 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -340,7 +341,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
var endPosV = endPos.getVertex(); var endPosV = endPos.getVertex();
sPos.setVertex( rootX, rootY ); sPos.setVertex( rootX, rootY );
connect.bezier.setPoints( [ sPos, endPos ] ).stroke( nodeStyle.stroke ); connect.bezier.setPoints( [ sPos, endPos ] ).stroke( nodeStyle.stroke );
connect.circle.setCenter( endPosV.x + ( Layout.appendside === "left" ? 1 : -1.5 ), endPosV.y ).fill( "white" ).setRadius( 4 ); connect.circle.setCenter( endPosV.x + ( Layout.appendside === "left" ? -0.5 : -1.5 ), endPosV.y ).fill( "white" ).setRadius( 4 );
} else if ( nodeType === "sub" ) { } else if ( nodeType === "sub" ) {
if ( !Layout.connect ) { if ( !Layout.connect ) {
connect = Layout.connect = new kity.Path(); connect = Layout.connect = new kity.Path();
......
...@@ -44,9 +44,11 @@ KM.ui.define( 'modal', { ...@@ -44,9 +44,11 @@ KM.ui.define( 'modal', {
$( this ).toggleClass( 'kmui-hover' ) $( this ).toggleClass( 'kmui-hover' )
} ); } );
setTimeout(function() { setTimeout( function () {
$('.kmui-modal').draggable({ handle: '.kmui-modal-header' }); $( '.kmui-modal' ).draggable( {
}, 100); handle: '.kmui-modal-header'
} );
}, 100 );
}, },
toggle: function () { toggle: function () {
var me = this; var me = this;
...@@ -71,7 +73,9 @@ KM.ui.define( 'modal', { ...@@ -71,7 +73,9 @@ KM.ui.define( 'modal', {
.trigger( 'aftershow' ); .trigger( 'aftershow' );
} ); } );
$('.kmui-modal').draggable({ handle: '.kmui-modal-header' }); $( '.kmui-modal' ).draggable( {
handle: '.kmui-modal-header'
} );
}, },
showTip: function ( text ) { showTip: function ( text ) {
$( '.kmui-modal-tip', this.root() ).html( text ).fadeIn(); $( '.kmui-modal-tip', this.root() ).html( text ).fadeIn();
......
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