fix #1751 sticky selection on in IE11
This commit is contained in:
parent
09d6741a02
commit
6e14e92912
2 changed files with 9 additions and 6 deletions
|
|
@ -161,7 +161,7 @@ exports.addMouseWheelListener = function(el, callback) {
|
|||
|
||||
exports.addMultiMouseDownListener = function(el, timeouts, eventHandler, callbackName) {
|
||||
var clicks = 0;
|
||||
var startX, startY, timer;
|
||||
var startX, startY, timer;
|
||||
var eventNames = {
|
||||
2: "dblclick",
|
||||
3: "tripleclick",
|
||||
|
|
@ -180,9 +180,12 @@ exports.addMultiMouseDownListener = function(el, timeouts, eventHandler, callbac
|
|||
}
|
||||
if (useragent.isIE) {
|
||||
var isNewClick = Math.abs(e.clientX - startX) > 5 || Math.abs(e.clientY - startY) > 5;
|
||||
if (isNewClick) {
|
||||
if (!timer || isNewClick)
|
||||
clicks = 1;
|
||||
}
|
||||
if (timer)
|
||||
clearTimeout(timer)
|
||||
timer = setTimeout(function() {timer = null}, timeouts[clicks - 1] || 600);
|
||||
|
||||
if (clicks == 1) {
|
||||
startX = e.clientX;
|
||||
startY = e.clientY;
|
||||
|
|
|
|||
|
|
@ -49,10 +49,10 @@ var MouseHandler = function(editor) {
|
|||
var mouseTarget = editor.renderer.getMouseEventTarget();
|
||||
event.addListener(mouseTarget, "click", this.onMouseEvent.bind(this, "click"));
|
||||
event.addListener(mouseTarget, "mousemove", this.onMouseMove.bind(this, "mousemove"));
|
||||
event.addMultiMouseDownListener(mouseTarget, [300, 300, 250], this, "onMouseEvent");
|
||||
event.addMultiMouseDownListener(mouseTarget, [400, 300, 250], this, "onMouseEvent");
|
||||
if (editor.renderer.scrollBarV) {
|
||||
event.addMultiMouseDownListener(editor.renderer.scrollBarV.inner, [300, 300, 250], this, "onMouseEvent");
|
||||
event.addMultiMouseDownListener(editor.renderer.scrollBarH.inner, [300, 300, 250], this, "onMouseEvent");
|
||||
event.addMultiMouseDownListener(editor.renderer.scrollBarV.inner, [400, 300, 250], this, "onMouseEvent");
|
||||
event.addMultiMouseDownListener(editor.renderer.scrollBarH.inner, [400, 300, 250], this, "onMouseEvent");
|
||||
}
|
||||
event.addMouseWheelListener(editor.container, this.onMouseWheel.bind(this, "mousewheel"));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue