Commit 43d9ab52 authored by techird's avatar techird

dev

parent 4d335a41
...@@ -90,6 +90,9 @@ KityMinder.registerModule( "KeyboardModule", function () { ...@@ -90,6 +90,9 @@ KityMinder.registerModule( "KeyboardModule", function () {
var KBRemoveCommand = kity.createClass( { var KBRemoveCommand = kity.createClass( {
base: Command, base: Command,
execute: function ( km, nodes ) { execute: function ( km, nodes ) {
if ( !nodes.length ) {
return;
}
km.clearSelect( nodes ); km.clearSelect( nodes );
var select = this.getNextSelection( km, nodes ); var select = this.getNextSelection( km, nodes );
km.execCommand( 'removeNode', nodes ); km.execCommand( 'removeNode', nodes );
...@@ -151,6 +154,10 @@ KityMinder.registerModule( "KeyboardModule", function () { ...@@ -151,6 +154,10 @@ KityMinder.registerModule( "KeyboardModule", function () {
case 8: case 8:
case 46: case 46:
// Backspace or Delete // Backspace or Delete
var rootIndex = sNodes.indexOf( this.getRoot() );
if ( rootIndex != -1 ) {
sNodes.splice( rootIndex, 1 );
}
this.execCommand( 'kbRemove', sNodes ); this.execCommand( 'kbRemove', sNodes );
break; break;
......
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