Commit 6475e1bc authored by campaign's avatar campaign

by zhanyi

parent 22de9999
...@@ -231,17 +231,18 @@ Minder.Receiver = kity.createClass('Receiver',{ ...@@ -231,17 +231,18 @@ Minder.Receiver = kity.createClass('Receiver',{
var currentIndex = this.getIndexByMousePosition(offset,dir); var currentIndex = this.getIndexByMousePosition(offset,dir);
if(currentIndex == 0 || currentIndex == this.textData.length ){ if(currentIndex == 0){
this.selection.setEndOffset(currentIndex); this.selection.setStartOffset(0)
}else if(currentIndex == this.textData.length){
this.selection.setEndOffset(currentIndex)
}else{ }else{
if(dir == -1 && currentIndex < this.selection.startOffset){ if(currentIndex > this.index){
this.selection.setEndOffset(currentIndex)
}else if(currentIndex < this.index){
this.selection.setStartOffset(currentIndex) this.selection.setStartOffset(currentIndex)
}else{ }else{
this.selection.setEndOffset(currentIndex); this.selection.collapse()
} }
console.log(this.selection.startOffset + ':' + this.selection.endOffset)
console.log(this.selection.isCollapsed)
} }
......
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