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.
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();
}
};