Commit b3cf2e7a authored by campaign's avatar campaign

修复shift+方向键的问题

parent e00b53eb
...@@ -161,7 +161,9 @@ Minder.Receiver = kity.createClass('Receiver', { ...@@ -161,7 +161,9 @@ Minder.Receiver = kity.createClass('Receiver', {
break; break;
case 'beforekeydown': case 'beforekeydown':
console.log('AA')
this.isTypeText = keyCode == 229 || keyCode === 0; this.isTypeText = keyCode == 229 || keyCode === 0;
switch (keyCode) { switch (keyCode) {
case keymap.Enter: case keymap.Enter:
case keymap.Tab: case keymap.Tab:
...@@ -198,6 +200,7 @@ Minder.Receiver = kity.createClass('Receiver', { ...@@ -198,6 +200,7 @@ Minder.Receiver = kity.createClass('Receiver', {
} }
//针对按住shift+方向键进行处理 //针对按住shift+方向键进行处理
if(orgEvt.shiftKey && keymap.direction[keyCode] && this.selection.isShow()){ if(orgEvt.shiftKey && keymap.direction[keyCode] && this.selection.isShow()){
if(this.selection.baseOffset === null){ if(this.selection.baseOffset === null){
this.selection.baseOffset = this.selection.startOffset; this.selection.baseOffset = this.selection.startOffset;
...@@ -238,6 +241,9 @@ Minder.Receiver = kity.createClass('Receiver', { ...@@ -238,6 +241,9 @@ Minder.Receiver = kity.createClass('Receiver', {
this.updateSelectionShow(); this.updateSelectionShow();
e.preventDefault(); e.preventDefault();
return; return;
}else if(keymap.direction[keyCode]){
this.selection.baseOffset =
this.selection.currentEndOffset = null;
} }
if (e.originEvent.ctrlKey || e.originEvent.metaKey) { if (e.originEvent.ctrlKey || e.originEvent.metaKey) {
......
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