Commit ce3ebde0 authored by Akikonata's avatar Akikonata

fixed drag bug

parent 9441cd83
......@@ -21,8 +21,8 @@ var MoveToParentCommand = kity.createClass( 'MoveToParentCommand', {
for ( var i = nodes.length - 1; i >= 0; i-- ) {
node = nodes[ i ];
if ( node.getParent() ) {
minder.removeNode([node]);
minder.appendChildNode(parent,node)
minder.removeNode( [ node ] );
minder.appendChildNode( parent, node );
}
}
minder.select( nodes, true );
......@@ -127,6 +127,7 @@ var DragBox = kity.createClass( "DragBox", {
this.remove();
this._dragMode = false;
this._dropSucceedTarget = null;
this._removeDropHint();
},
_drawForDragMode: function () {
this._text.setContent( this._dragSources.length + ' items' );
......@@ -191,6 +192,13 @@ var DragBox = kity.createClass( "DragBox", {
this._lastSucceedTarget = target;
},
_removeDropHint: function () {
var lastTarget = this._lastSucceedTarget;
if ( lastTarget ) {
this._removeDropStyle( lastTarget );
}
},
_removeDropStyle: function ( node ) {
node._layout.bgRect.stroke( 'none' );
this._rect.stroke( '#3399ff', 1 );
......
......@@ -573,6 +573,9 @@ 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.getData( "expand" ) === false ) {
minder.expandNode( parent );
}
minder.handelNodeInsert( node );
node.clearLayout();
node.getContRc().clear();
......
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