From 0af652676963c900add5e756a72abd66e356d635 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 9 Jun 2012 18:08:35 +0400 Subject: [PATCH] do not start drag on ctrl+click --- lib/ace/mouse/default_handlers.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/ace/mouse/default_handlers.js b/lib/ace/mouse/default_handlers.js index 9af13079..1b916801 100644 --- a/lib/ace/mouse/default_handlers.js +++ b/lib/ace/mouse/default_handlers.js @@ -109,13 +109,8 @@ function DefaultHandlers(mouseHandler) { // a selection. this.startSelect(pos); } else if (inSelection) { - var e = ev.domEvent; - if ((e.ctrlKey || e.altKey)) { - this.startDrag(); - } else { - this.mousedownEvent.time = (new Date()).getTime(); - this.setState("dragWait"); - } + this.mousedownEvent.time = (new Date()).getTime(); + this.setState("dragWait"); } this.captureMouse(ev); @@ -223,7 +218,7 @@ function DefaultHandlers(mouseHandler) { this.startSelect(); }; - this.dragWait = function() { + this.dragWait = function(e) { var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y); var time = (new Date()).getTime(); var editor = this.editor; @@ -231,7 +226,7 @@ function DefaultHandlers(mouseHandler) { if (distance > DRAG_OFFSET) { this.startSelect(); } else if (time - this.mousedownEvent.time > editor.getDragDelay()) { - this.startDrag() + this.startDrag(); } };