Commit e01af8c5 authored by campaign's avatar campaign

改进输入

parent 346738a3
......@@ -30,11 +30,12 @@ KityMinder.registerModule('TextEditModule', function() {
.setEndOffset(textShape.getContent().length)
.setColor(color);
receiver
.setMinderNode(node)
.updateContainerRangeBySel();
if(browser.ie){
if(browser.ie || browser.gecko){
var timer = setInterval(function(){
var nativeRange = range.nativeSel.getRangeAt(0);
if(!nativeRange || nativeRange.collapsed){
......
......@@ -254,7 +254,7 @@ Minder.Receiver = kity.createClass('Receiver', {
//粘贴
if (keyCode == keymap.v) {
setTimeout(function() {
setTimeout(function () {
me.range.updateNativeRange().insertNode($('<span>$$_kityminder_bookmark_$$</span>')[0]);
me.container.innerHTML = utils.unhtml(me.container.textContent.replace(/[\u200b\t\r\n]/g, ''));
var index = me.container.textContent.indexOf('$$_kityminder_bookmark_$$');
......@@ -266,28 +266,12 @@ Minder.Receiver = kity.createClass('Receiver', {
}
//剪切
if (keyCode == keymap.x) {
setTimeout(function() {
setTimeout(function () {
setTextToContainer(keyCode);
}, 100);
return;
}
// //全选键位监控
// if (keymap.a == keyCode) {
// if(me.selection.isHide()){
// return;
// }else{
// me.selection
// .setStartOffset(0)
// .setEndOffset(me.textShape.getContent().length);
// me.updateContainerRangeBySel().updateSelectionShow();
// return;
// }
// }
}
//针对不能连续删除做处理
if(keymap.Del == keyCode || keymap.Backspace == keyCode)
setTextToContainer(keyCode);
......@@ -545,7 +529,6 @@ Minder.Receiver = kity.createClass('Receiver', {
return this;
},
updateContainerRangeBySel:function(){
var node = this.container.firstChild;
this.range.setStart(node, this.selection.startOffset);
this.range.setEnd(node, this.selection.endOffset);
......
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