!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: Nick Campbell <nicholas.j.campbell@gmail.com>
pull/1/head
Nick Campbell 14 years ago
parent 2d15fdc225
commit 54ce0b2e75

@ -146,6 +146,8 @@ The plugin allso adds the following methods to the plot object:
function getSelection() {
if (!selectionIsSane())
return null;
if (!selection.show) return null;
var r = {}, c1 = selection.first, c2 = selection.second;
$.each(plot.getAxes(), function (name, axis) {

Loading…
Cancel
Save