Commit d16bcc7a authored by campaign's avatar campaign

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

parents 408f2ed0 476dd4c3
This diff is collapsed.
......@@ -89,6 +89,9 @@ KityMinder.registerModule( "LayoutModule", function () {
base: Command,
execute: function ( km, node ) {
var parent = km.getSelectedNode();
if ( !parent ) {
return false;
}
km.appendChildNode( parent, node );
km.select( node, true );
return node;
......@@ -100,6 +103,9 @@ KityMinder.registerModule( "LayoutModule", function () {
base: Command,
execute: function ( km, node ) {
var selectedNode = km.getSelectedNode();
if ( !selectedNode ) {
return false;
}
if ( selectedNode.isRoot() ) {
node.setType( "main" );
km.appendChildNode( selectedNode, node );
......
......@@ -5,7 +5,7 @@ KityMinder.registerModule( "MouseModule", function () {
return kity.Vector.fromPoints( e.kityEvent.getPosition( 0 ), e.kityEvent.getPosition( 1 ) ).length();
}
var SelectArea = this.SelectArea = ( function () {
var SelectArea = ( function () {
var startPos = null;
var selectRect = null;
var min = function ( a, b ) {
......@@ -80,7 +80,7 @@ KityMinder.registerModule( "MouseModule", function () {
this.select( clickNode, true );
} else {
this.removeAllSelectedNodes();
this.SelectArea.selectStart( e );
SelectArea.selectStart( e );
}
},
'touchstart': function ( e ) {
......@@ -113,10 +113,10 @@ KityMinder.registerModule( "MouseModule", function () {
}
},
'mousemove touchmove': function ( e ) {
this.SelectArea.selectMove( e );
SelectArea.selectMove( e );
},
'touchend mouseup': function ( e ) {
this.SelectArea.selectEnd( e );
SelectArea.selectEnd( e );
}
}
};
......
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