Commit b4238c81 authored by campaign's avatar campaign

by zhanyi

parent 30e37603
...@@ -82,14 +82,17 @@ Minder.Receiver = kity.createClass('Receiver',{ ...@@ -82,14 +82,17 @@ Minder.Receiver = kity.createClass('Receiver',{
case 'beforekeyup': case 'beforekeyup':
if(this.isTextEditStatus()){ if(this.isTextEditStatus()){
switch(keyCode){
if(keyCode == keymap.Enter){ case keymap.Enter:
this.setTextEditStatus(false); case keymap.Tab:
this.clear(); this.setTextEditStatus(false);
e.stopPropagation(); this.clear();
return; e.stopPropagation();
return;
} }
var text = (this.container.textContent || this.container.innerText).replace(/\u200b/g,''); var text = (this.container.textContent || this.container.innerText).replace(/\u200b/g,'');
this.textShape.setContent(text); this.textShape.setContent(text);
this.setContainerStyle(); this.setContainerStyle();
......
...@@ -63,34 +63,34 @@ KityMinder.registerModule( "KeyboardModule", function () { ...@@ -63,34 +63,34 @@ KityMinder.registerModule( "KeyboardModule", function () {
switch ( e.originEvent.keyCode ) { switch ( e.originEvent.keyCode ) {
case keymap.Enter: case keymap.Enter:
this.execCommand( 'appendSiblingNode', new MinderNode( 'Topic' ) ); this.execCommand( 'appendSiblingNode', new MinderNode( 'Topic' ) );
e.preventDefault(); e.preventDefault();
break; break;
case keymap.Tab: case keymap.Tab:
this.execCommand( 'appendChildNode', new MinderNode( 'Topic' ) ); this.execCommand( 'appendChildNode', new MinderNode( 'Topic' ) );
e.preventDefault(); e.preventDefault();
break; break;
case keymap.Backspace: case keymap.Backspace:
case keymap.Del: case keymap.Del:
this.execCommand( 'removenode' ); this.execCommand( 'removenode' );
e.preventDefault(); e.preventDefault();
break; break;
case keymap.Left: case keymap.Left:
case keymap.up: case keymap.up:
case keymap.Right: case keymap.Right:
case keymap.Down: case keymap.Down:
if ( this.isSingleSelect() ) { if ( this.isSingleSelect() ) {
KBNavigate( this, { KBNavigate( this, {
37: 'left', 37: 'left',
38: 'top', 38: 'top',
39: 'right', 39: 'right',
40: 'down' 40: 'down'
}[ e.originEvent.keyCode ] ); }[ e.originEvent.keyCode ] );
} }
e.preventDefault(); e.preventDefault();
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