Commit 57ba2ba0 authored by campaign's avatar campaign

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

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