do not start drag on ctrl+click

This commit is contained in:
nightwing 2012-06-09 18:08:35 +04:00
commit 0af6526769

View file

@ -109,13 +109,8 @@ function DefaultHandlers(mouseHandler) {
// a selection. // a selection.
this.startSelect(pos); this.startSelect(pos);
} else if (inSelection) { } else if (inSelection) {
var e = ev.domEvent; this.mousedownEvent.time = (new Date()).getTime();
if ((e.ctrlKey || e.altKey)) { this.setState("dragWait");
this.startDrag();
} else {
this.mousedownEvent.time = (new Date()).getTime();
this.setState("dragWait");
}
} }
this.captureMouse(ev); this.captureMouse(ev);
@ -223,7 +218,7 @@ function DefaultHandlers(mouseHandler) {
this.startSelect(); this.startSelect();
}; };
this.dragWait = function() { this.dragWait = function(e) {
var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y); var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);
var time = (new Date()).getTime(); var time = (new Date()).getTime();
var editor = this.editor; var editor = this.editor;
@ -231,7 +226,7 @@ function DefaultHandlers(mouseHandler) {
if (distance > DRAG_OFFSET) { if (distance > DRAG_OFFSET) {
this.startSelect(); this.startSelect();
} else if (time - this.mousedownEvent.time > editor.getDragDelay()) { } else if (time - this.mousedownEvent.time > editor.getDragDelay()) {
this.startDrag() this.startDrag();
} }
}; };