diff --git a/jquery.flot.crosshair.js b/jquery.flot.crosshair.js index c602480..30b1ec9 100644 --- a/jquery.flot.crosshair.js +++ b/jquery.flot.crosshair.js @@ -105,14 +105,14 @@ The plugin also adds four public methods: }); eventHolder.mousemove(function (e) { + if (crosshair.locked) + return; + if (plot.getSelection && plot.getSelection()) { crosshair.x = -1; // hide the crosshair while selecting return; } - if (crosshair.locked) - return; - var offset = plot.offset(); crosshair.x = Math.max(0, Math.min(e.pageX - offset.left, plot.width())); crosshair.y = Math.max(0, Math.min(e.pageY - offset.top, plot.height()));