Commit cfa6c9a3 authored by techird's avatar techird

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

parents 64b250b0 b5904d59
......@@ -112,7 +112,6 @@ KityMinder.registerModule('TextEditModule', function() {
.setRange(range)
.setReady();
if(selectionReadyShow){
......@@ -124,12 +123,13 @@ KityMinder.registerModule('TextEditModule', function() {
dblclickEvent = false;
return;
}
sel.collapse(true)
.updatePosition(receiver.getOffsetByIndex())
.setShow();
textGroup.setStyle('cursor','text');
}, 200);
},200);
km.setStatus('textedit');
}
......
......@@ -53,7 +53,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
this._keyup(e);
}
},
_setTextToContainer : function(keyCode){
_setTextToContainer : function(keyCode,iskeyUp){
var me = this;
//同步节点
me.minderNode = me.re.minderNode;
......@@ -65,7 +65,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
}
if(keymap.controlKeys[keyCode]){
if(keymap.controlKeys[keyCode] && !iskeyUp ){
return;
}
//当第一次输入内容时进行保存
......@@ -98,6 +98,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
},300);
}
me.re.updateTextOffsetData()
.updateRange()
.updateSelectionByRange();
......@@ -193,7 +194,6 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
//修正在cvs方式下_keyup会把节点文字选中
this.isShortcutCopyKey = true;
this.km.setStatus('normal');
return;
}
......@@ -241,7 +241,6 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
me._setTextToContainer(keyCode);
},
_beforeKeyup:function(e){
var me = this;
var orgEvt = e.originEvent;
var keyCode = orgEvt.keyCode;
......@@ -265,7 +264,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
}
if (keymap.Enter == keyCode && (this.isTypeText || browser.mac && browser.gecko)) {
me._setTextToContainer(keyCode);
me._setTextToContainer(keyCode,true);
}
if (this.re.keydownNode === this.re.minderNode) {
this.km.rollbackStatus();
......@@ -283,19 +282,20 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
}
}
me._setTextToContainer(keyCode);
me._setTextToContainer(keyCode,true);
return;
}
if (this.isTypeText) {
me._setTextToContainer(keyCode);
me._setTextToContainer(keyCode,true);
return;
}
if (browser.mac && browser.gecko){
me._setTextToContainer(keyCode);
me._setTextToContainer(keyCode,true);
return;
}
me._setTextToContainer(keyCode);
me._setTextToContainer(keyCode,true);
return true;
},
......
......@@ -86,7 +86,7 @@ Minder.Selection = kity.createClass( 'Selection', {
'z'];
};
offset = offset || this.offset;
offset = offset !== undefined ? offset : this.offset;
if(this.collapsed){
if (isNaN(offset.x) || isNaN(offset.y)) {
......
......@@ -232,7 +232,7 @@ KityMinder.registerModule('View', function() {
var minder = this;
['up', 'down', 'left', 'right'].forEach(function(name) {
if (e.isShortcutKey('ctrl+' + name)) {
if (e.isShortcutKey('ctrl+' + name) && minder.getStatus() != 'textedit') {
minder.removeAllSelectedNodes();
minder.execCommand('move', name, 100);
e.preventDefault();
......
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