From 83ff885351fe0ee0a93abaae3e61e948d6da3c6d Mon Sep 17 00:00:00 2001 From: Trevor Bedford Date: Sat, 25 Feb 2017 23:47:13 -0800 Subject: [PATCH] Simple fix to legend toggle No longer beautiful. But functional. Fixes #205. --- src/components/tree/legend.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/tree/legend.js b/src/components/tree/legend.js index 9e4610c42..ac25b05ca 100644 --- a/src/components/tree/legend.js +++ b/src/components/tree/legend.js @@ -54,6 +54,9 @@ class Legend extends React.Component { } getSVGHeight() { + if (!this.state.legendVisible) { + return 18; + } let nItems = 10; const titlePadding = 20; if (this.props.colorScale.scale) { @@ -169,12 +172,15 @@ class Legend extends React.Component { ); }); } + // This gives the nice looking show/hide animation. Should restore while maintaining + // legend collapse functionality. + // return ( - + {items}