Commit 54ce0b2e authored by Nick Campbell's avatar Nick Campbell

!selection.show => return null from getSelection

If we've called `clearSelection`, then calling `getSelection` shouldn't
return the old selection values. When calling `getSelection` before a
selection is made, `null` is returned. It seemed appropriate to do the
same if `selection.show` was falsy.
Signed-off-by: 's avatarNick Campbell <nicholas.j.campbell@gmail.com>
parent 2d15fdc2
...@@ -147,6 +147,8 @@ The plugin allso adds the following methods to the plot object: ...@@ -147,6 +147,8 @@ The plugin allso adds the following methods to the plot object:
if (!selectionIsSane()) if (!selectionIsSane())
return null; return null;
if (!selection.show) return null;
var r = {}, c1 = selection.first, c2 = selection.second; var r = {}, c1 = selection.first, c2 = selection.second;
$.each(plot.getAxes(), function (name, axis) { $.each(plot.getAxes(), function (name, axis) {
if (axis.used) { if (axis.used) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment