Fix an issue with the right click triggering the select area

pull/1/head
yflory 8 years ago
parent ef58120819
commit d9b5eb8a97

@ -286,7 +286,7 @@ define([
} }
}; };
$content.on('mousedown', function (e) { $content.on('mousedown', function (e) {
console.log('down'); if (e.which !== 1) { return; }
sel.down = true; sel.down = true;
if (!e.ctrlKey) { removeSelected(); } if (!e.ctrlKey) { removeSelected(); }
var rect = e.currentTarget.getBoundingClientRect(); var rect = e.currentTarget.getBoundingClientRect();
@ -298,7 +298,7 @@ define([
width: '0px', width: '0px',
height: '0px' height: '0px'
}); });
if (sel.move) { console.log('ret'); return; } if (sel.move) { return; }
sel.move = function (ev) { sel.move = function (ev) {
var rectMove = ev.currentTarget.getBoundingClientRect(), var rectMove = ev.currentTarget.getBoundingClientRect(),
offX = ev.clientX - rectMove.left, offX = ev.clientX - rectMove.left,
@ -342,7 +342,6 @@ define([
sel.to = undefined; sel.to = undefined;
}, (sel.refresh - diffT)); }, (sel.refresh - diffT));
} }
console.log('cancelled');
return; return;
} }
sel.update = +new Date(); sel.update = +new Date();
@ -351,7 +350,7 @@ define([
$content.mousemove(sel.move); $content.mousemove(sel.move);
}); });
$content.on('mouseup', function (e) { $content.on('mouseup', function (e) {
console.log(sel.pos); if (e.which !== 1) { return; }
sel.down = false; sel.down = false;
sel.$selectBox.hide(); sel.$selectBox.hide();
$content.off('mousemove', sel.move); $content.off('mousemove', sel.move);

Loading…
Cancel
Save