Commit 7072e273 authored by campaign's avatar campaign

merge hot-fix

parent cabdf85f
...@@ -141,7 +141,6 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -141,7 +141,6 @@ Minder.Receiver = kity.createClass( 'Receiver', {
this.km.setStatus( 'normal' ); this.km.setStatus( 'normal' );
e.preventDefault(); e.preventDefault();
return; return;
break;
case keymap.Shift: case keymap.Shift:
case keymap.Control: case keymap.Control:
case keymap.Alt: case keymap.Alt:
...@@ -256,7 +255,7 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -256,7 +255,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
}, },
setContainerStyle: function () { setContainerStyle: function () {
var textShapeBox = this.getBaseOffset( 'screen' ); var textShapeBox = this.getBaseOffset( 'screen' );
this.container.style.cssText = ";left:" + textShapeBox.x + 'px;top:' + ( textShapeBox.y + textShapeBox.height *.1 ) + 'px;width:' + textShapeBox.width + 'px;height:' + textShapeBox.height + 'px;'; this.container.style.cssText = ";left:" + textShapeBox.x + 'px;top:' + ( textShapeBox.y + textShapeBox.height * 0.1 ) + 'px;width:' + textShapeBox.width + 'px;height:' + textShapeBox.height + 'px;';
if ( !this.selection.isShow() ) { if ( !this.selection.isShow() ) {
var paperContainer = this.km.getPaper(); var paperContainer = this.km.getPaper();
...@@ -335,7 +334,7 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -335,7 +334,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
var me = this; var me = this;
utils.each( this.textData, function ( i, v ) { utils.each( this.textData, function ( i, v ) {
//点击开始之前 //点击开始之前
if ( i == 0 && offset.x <= v.x ) { if ( i === 0 && offset.x <= v.x ) {
me.selection.setStartOffset( 0 ); me.selection.setStartOffset( 0 );
return false; return false;
} }
...@@ -347,18 +346,18 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -347,18 +346,18 @@ Minder.Receiver = kity.createClass( 'Receiver', {
if ( offset.x >= v.x && offset.x <= v.x + v.width ) { if ( offset.x >= v.x && offset.x <= v.x + v.width ) {
if ( me.index == i ) { if ( me.index == i ) {
if ( i == 0 ) { if ( i === 0 ) {
me.selection.setStartOffset( i ) me.selection.setStartOffset( i );
} }
if ( offset.x <= v.x + v.width / 2 ) { if ( offset.x <= v.x + v.width / 2 ) {
me.selection.collapse() me.selection.collapse();
} else { } else {
me.selection.setEndOffset( i + ( ( me.selection.endOffset > i || dir == 1 ) && i != me.textData.length - 1 ? 1 : 0 ) ) me.selection.setEndOffset( i + ( ( me.selection.endOffset > i || dir == 1 ) && i != me.textData.length - 1 ? 1 : 0 ) );
} }
} else if ( i > me.index ) { } else if ( i > me.index ) {
me.selection.setStartOffset( me.index ); me.selection.setStartOffset( me.index );
me.selection.setEndOffset( i + 1 ) me.selection.setEndOffset( i + 1 );
} else { } else {
if ( dir == 1 ) { if ( dir == 1 ) {
me.selection.setStartOffset( i + ( offset.x >= v.x + v.width / 2 && i != me.textData.length - 1 ? 1 : 0 ) ); me.selection.setStartOffset( i + ( offset.x >= v.x + v.width / 2 && i != me.textData.length - 1 ? 1 : 0 ) );
...@@ -366,7 +365,7 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -366,7 +365,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
me.selection.setStartOffset( i ); me.selection.setStartOffset( i );
} }
me.selection.setEndOffset( me.index ) me.selection.setEndOffset( me.index );
} }
return false; return false;
...@@ -387,7 +386,7 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -387,7 +386,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
var lastOffset = this.textData[ this.textData.length - 1 ]; var lastOffset = this.textData[ this.textData.length - 1 ];
width = lastOffset.x - startOffset.x + lastOffset.width; width = lastOffset.x - startOffset.x + lastOffset.width;
} catch ( e ) { } catch ( e ) {
console.log( 'e' ) console.log( 'e' );
} }
} else { } else {
...@@ -406,7 +405,7 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -406,7 +405,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
}, },
setIndex: function ( index ) { setIndex: function ( index ) {
this.index = index; this.index = index;
return this return this;
}, },
setContainerTxt: function ( txt ) { setContainerTxt: function ( txt ) {
this.container.textContent = txt; this.container.textContent = txt;
......
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