Commit 290f1339 authored by Akikonata's avatar Akikonata

fixed layout bug

parent 39b21a35
......@@ -31,20 +31,20 @@ kity.extendClass( Minder, function () {
} );
this._selectedNodes = [];
},
removeSelectedNodes:function(nodes){
removeSelectedNodes: function ( nodes ) {
var me = this;
Utils.each( Utils.isArray( nodes ) ? nodes : [ nodes ], function ( i, n ) {
if ( me._selectedNodes.indexOf( n ) === -1 )return;
me._selectedNodes.splice(i,1);
if ( me._selectedNodes.indexOf( n ) === -1 ) return;
me._selectedNodes.splice( i, 1 );
unhighlightNode( me, n );
} );
return this;
},
select: function ( nodes,isToggleSelect ) {
select: function ( nodes, isToggleSelect ) {
isToggleSelect && this.removeAllSelectedNodes();
var me = this;
Utils.each( Utils.isArray( nodes ) ? nodes : [ nodes ], function ( i, n ) {
if ( me._selectedNodes.indexOf( n ) !== -1 )return;
if ( me._selectedNodes.indexOf( n ) !== -1 ) return;
me._selectedNodes.push( n );
highlightNode( me, n );
} );
......
......@@ -409,7 +409,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
if ( _buffer.length !== 0 ) {
for ( var i = 0; i < _buffer.length; i++ ) {
var point = _buffer[ i ].getPoint();
if ( point ) {
if ( point && point.x && point.y ) {
if ( point.x > Layout.x ) {
Layout.rightList.push( _buffer[ i ] );
} else {
......
......@@ -85,7 +85,7 @@ KityMinder.registerModule( "LayoutModule", function () {
execute: function ( km, node ) {
var parent = km.getSelectedNode();
km.appendChildNode( parent, node );
km.select( node,true );
km.select( node, true );
return node;
}
};
......@@ -100,7 +100,7 @@ KityMinder.registerModule( "LayoutModule", function () {
} else {
km.appendSiblingNode( selectedNode, node );
}
km.select( node,true );
km.select( node, true );
return node;
}
};
......
......@@ -76,7 +76,7 @@ KityMinder.registerModule( "MouseModule", function () {
if ( e.originEvent.touches && e.originEvent.touches.length != 1 ) return;
var clickNode = e.getTargetNode();
if ( clickNode ) {
this.select( clickNode );
this.select( clickNode, true );
} else {
this.removeAllSelectedNodes();
this.SelectArea.selectStart( 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