properly remove old selectionMarkers
This commit is contained in:
parent
2d90f50491
commit
5d97f70a4e
3 changed files with 6 additions and 6 deletions
|
|
@ -79,11 +79,10 @@ EventEmitter._signal = function(eventName, e) {
|
|||
|
||||
EventEmitter.once = function(eventName, callback) {
|
||||
var _self = this;
|
||||
var newCallback = function() {
|
||||
fun && fun.apply(null, arguments);
|
||||
_self.removeEventListener(event, newCallback);
|
||||
};
|
||||
this.addEventListener(event, newCallback);
|
||||
callback && this.addEventListener(eventName, function newCallback() {
|
||||
_self.removeEventListener(eventName, newCallback);
|
||||
callback.apply(null, arguments);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -121,6 +121,7 @@ var MouseHandler = function(editor) {
|
|||
renderer.$moveTextAreaToCursor();
|
||||
}
|
||||
self.isMousePressed = false;
|
||||
self.onMouseEvent("mouseup", e)
|
||||
};
|
||||
|
||||
var onCaptureInterval = function() {
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ function onMouseDown(e) {
|
|||
|
||||
var oldRange = selection.rangeList.rangeAtPoint(pos);
|
||||
|
||||
event.capture(editor.container, function(){}, function() {
|
||||
editor.once("mouseup", function() {
|
||||
var tmpSel = selection.toOrientedRange();
|
||||
|
||||
if (oldRange && tmpSel.isEmpty() && isSamePoint(oldRange.cursor, tmpSel.cursor))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue