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