Commit b96701df authored by Akikonata's avatar Akikonata

added select

parent 40b114a2
...@@ -110,8 +110,17 @@ KityMinder.registerModule( "LayoutModule", function () { ...@@ -110,8 +110,17 @@ KityMinder.registerModule( "LayoutModule", function () {
base: Command, base: Command,
execute: function ( km ) { execute: function ( km ) {
var selectedNodes = km.getSelectedNodes(); var selectedNodes = km.getSelectedNodes();
console.log( selectedNodes ); var _buffer = [];
for ( var i = 0; i < selectedNodes.length; i++ ) {
_buffer.push( selectedNodes[ i ] );
}
while ( _buffer.length !== 1 ) {
var parent = _buffer[ 0 ].getParent();
if ( parent && _buffer.indexOf( parent ) === -1 ) _buffer.push( parent );
_buffer.shift();
}
km.removeNode( selectedNodes ); km.removeNode( selectedNodes );
km.select( _buffer[ 0 ] );
} }
}; };
} )() ); } )() );
......
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