Commit 44f35fea authored by techird's avatar techird

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

parents 92fd1f64 201b0f5e
......@@ -16,7 +16,7 @@ KityMinder.registerModule('TextEditModule', function() {
//当前是否有选区存在
var selectionReadyShow = false;
var mousedownNode,mouseupTimer;
var mousedownNode,mouseupTimer,mousedownTimer;
var lastMinderNode;
function inputStatusReady(node){
......@@ -117,8 +117,13 @@ KityMinder.registerModule('TextEditModule', function() {
sel.setShowStatus();
setTimeout(function() {
clearTimeout(mousedownTimer);
mousedownTimer = setTimeout(function() {
if(dblclickEvent){
dblclickEvent = false;
return;
}
sel.collapse(true)
.updatePosition(receiver.getOffsetByIndex())
.setShow();
......
......@@ -95,7 +95,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
me.inputTextTimer = setTimeout(function(){
me.km.layout(300);
},250);
},300);
}
me.re.updateTextOffsetData()
......@@ -104,8 +104,13 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
me.selection
.updateOffsetByTextData(me.re.textData)
.updatePosition()
.setHoldShow();
.updatePosition();
//当然inputready状态时,如果输入文字,节点内文本会被先选中然后再消失,体验不好
if(me.km.getStatus() != 'inputready'){
me.selection.setHoldShow();
}
me.timer = setTimeout(function() {
......@@ -230,8 +235,10 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
this.isShortcutCopyKey = false;
//针对不能连续删除做处理
if(keymap.Del == keyCode || keymap.Backspace == keyCode)
me._setTextToContainer(keyCode);
//if(keymap.Del == keyCode || keymap.Backspace == keyCode)
// me._setTextToContainer(keyCode);
me._setTextToContainer(keyCode);
},
_beforeKeyup:function(e){
......
......@@ -7,7 +7,12 @@ Minder.Range = kity.createClass('Range',function(){
if(node.nodeType == 1){
//默认不会出现得不到子节点的情况
node = node.childNodes[offset];
if(node.nodeType == 3){
if(!node && rng.startContainer && rng.startContainer.nodeName == 'DIV' ) {
rng.startContainer.innerHTML = '<p></p>';
offset = 0;
}else if(node.nodeType == 3){
offset = 0;
}
}
......
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