Commit c658355d authored by Akikonata's avatar Akikonata

test

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