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