Commit 9a9888fb authored by Akikonata's avatar Akikonata

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

parents d2d0c27e a8a2d3be
Subproject commit d4e00b314db4116a92583114bcb67ff9a3c4d48d
Subproject commit 256dce28fb1e574b18f0dd084f7503cbc25e2a80
......@@ -3,6 +3,9 @@ Minder.Range = kity.createClass('Range',{
this.nativeRange = document.createRange();
this.nativeSel = window.getSelection();
},
hasNativeRange : function(){
return this.nativeSel.rangeCount != 0 ;
},
select:function(){
var start = this.nativeRange.startContainer;
if(start.nodeType == 1 && start.childNodes.length == 0){
......
......@@ -83,6 +83,9 @@ Minder.Receiver = kity.createClass( 'Receiver', {
var keys = KityMinder.keymap;
function setTextToContainer() {
if(!me.range.hasNativeRange()){
return;
}
var text = me.container.textContent.replace( /[\u200b\t\r\n]/g, '' );
if ( me.textShape.getOpacity() == 0 ) {
......@@ -176,7 +179,6 @@ Minder.Receiver = kity.createClass( 'Receiver', {
break;
case 'beforekeyup':
switch ( keyCode ) {
case keymap.Enter:
case keymap.Tab:
......
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