Commit 5ee66b33 authored by techird's avatar techird

Merge branch 'release-1.2.0' of github.com:fex-team/kityminder into release-1.2.0

parents 973140e3 a3b39ce9
...@@ -261,9 +261,12 @@ KityMinder.registerModule('TextEditModule', function() { ...@@ -261,9 +261,12 @@ KityMinder.registerModule('TextEditModule', function() {
} }
receiver.clear(); // receiver.clear();
if (this.getStatus() == 'textedit') { // if (this.getStatus() == 'textedit') {
this.setStatus('normal'); // this.setStatus('normal');
// }
if(sel.isShow()){
receiver.updateTextOffsetData().updateSelection()
} }
}, },
'layoutfinish':function(e){ 'layoutfinish':function(e){
...@@ -271,12 +274,18 @@ KityMinder.registerModule('TextEditModule', function() { ...@@ -271,12 +274,18 @@ KityMinder.registerModule('TextEditModule', function() {
receiver receiver
.setBaseOffset() .setBaseOffset()
.setContainerStyle(); .setContainerStyle();
} }
}, },
'selectionclear': function() { 'selectionclear': function() {
km.setStatus('normal'); var node = km.getSelectedNode();
receiver.clear(); if(node){
inputStatusReady(node);
}else{
km.setStatus('normal');
receiver.clear();
}
}, },
'blur': function() { 'blur': function() {
receiver.clear(); receiver.clear();
......
...@@ -20,7 +20,9 @@ Minder.Receiver = kity.createClass('Receiver', { ...@@ -20,7 +20,9 @@ Minder.Receiver = kity.createClass('Receiver', {
var _div = document.createElement('div'); var _div = document.createElement('div');
_div.setAttribute('contenteditable', true); _div.setAttribute('contenteditable', true);
_div.className = 'km_receiver'; _div.className = 'km_receiver';
this.container = _div; this.container = _div;
if(browser.ipad) { if(browser.ipad) {
utils.listen(this.container, 'keydown keypress keyup input', function(e) { utils.listen(this.container, 'keydown keypress keyup input', function(e) {
me.keyboardEvents.call(me, new MinderEvent(e.type == 'keyup' ? 'beforekeyup' : e.type, e)); me.keyboardEvents.call(me, new MinderEvent(e.type == 'keyup' ? 'beforekeyup' : e.type, e));
...@@ -229,8 +231,8 @@ Minder.Receiver = kity.createClass('Receiver', { ...@@ -229,8 +231,8 @@ Minder.Receiver = kity.createClass('Receiver', {
case keymap.Alt: case keymap.Alt:
case keymap.Cmd: case keymap.Cmd:
case keymap.F2: case keymap.F2:
case keymap.Del: // case keymap.Del:
case keymap.Backspace: // case keymap.Backspace:
if(this.selection.isHide()){ if(this.selection.isHide()){
this.km.setStatus('normal'); this.km.setStatus('normal');
} }
...@@ -323,9 +325,9 @@ Minder.Receiver = kity.createClass('Receiver', { ...@@ -323,9 +325,9 @@ Minder.Receiver = kity.createClass('Receiver', {
} }
return; return;
} }
setTimeout(function() { //针对不能连续删除做处理
if(keymap.Del || keymap.Backspace)
setTextToContainer(keyCode); setTextToContainer(keyCode);
});
break; break;
case 'beforekeyup': case 'beforekeyup':
...@@ -370,9 +372,13 @@ Minder.Receiver = kity.createClass('Receiver', { ...@@ -370,9 +372,13 @@ Minder.Receiver = kity.createClass('Receiver', {
} }
if (this.isTypeText) { if (this.isTypeText) {
setTextToContainer(keyCode); setTextToContainer(keyCode);
return;
} }
if (browser.mac && browser.gecko) if (browser.mac && browser.gecko){
setTextToContainer(keyCode); setTextToContainer(keyCode);
return;
}
setTextToContainer(keyCode);
return true; return true;
} }
......
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