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) {
|
EventEmitter.once = function(eventName, callback) {
|
||||||
var _self = this;
|
var _self = this;
|
||||||
var newCallback = function() {
|
callback && this.addEventListener(eventName, function newCallback() {
|
||||||
fun && fun.apply(null, arguments);
|
_self.removeEventListener(eventName, newCallback);
|
||||||
_self.removeEventListener(event, newCallback);
|
callback.apply(null, arguments);
|
||||||
};
|
});
|
||||||
this.addEventListener(event, newCallback);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,7 @@ var MouseHandler = function(editor) {
|
||||||
renderer.$moveTextAreaToCursor();
|
renderer.$moveTextAreaToCursor();
|
||||||
}
|
}
|
||||||
self.isMousePressed = false;
|
self.isMousePressed = false;
|
||||||
|
self.onMouseEvent("mouseup", e)
|
||||||
};
|
};
|
||||||
|
|
||||||
var onCaptureInterval = function() {
|
var onCaptureInterval = function() {
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ function onMouseDown(e) {
|
||||||
|
|
||||||
var oldRange = selection.rangeList.rangeAtPoint(pos);
|
var oldRange = selection.rangeList.rangeAtPoint(pos);
|
||||||
|
|
||||||
event.capture(editor.container, function(){}, function() {
|
editor.once("mouseup", function() {
|
||||||
var tmpSel = selection.toOrientedRange();
|
var tmpSel = selection.toOrientedRange();
|
||||||
|
|
||||||
if (oldRange && tmpSel.isEmpty() && isSamePoint(oldRange.cursor, tmpSel.cursor))
|
if (oldRange && tmpSel.isEmpty() && isSamePoint(oldRange.cursor, tmpSel.cursor))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue