From b6cca6ffb2c4eb9861105dcf10c9a721efd044ce Mon Sep 17 00:00:00 2001 From: pinturic Date: Thu, 5 Nov 2015 11:14:27 +0100 Subject: [PATCH 1/2] Update left-nav.jsx Menu can be null if the MenuItems are inlined --- src/left-nav.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/left-nav.jsx b/src/left-nav.jsx index e01b11c12f19da..72761f4c0faac5 100644 --- a/src/left-nav.jsx +++ b/src/left-nav.jsx @@ -225,8 +225,10 @@ const LeftNav = React.createClass({ if (this.props.header) { let container = ReactDOM.findDOMNode(this.refs.clickAwayableElement); let menu = ReactDOM.findDOMNode(this.refs.menuItems); - let menuHeight = container.clientHeight - menu.offsetTop; - menu.style.height = menuHeight + 'px'; + if (menu){ + let menuHeight = container.clientHeight - menu.offsetTop; + menu.style.height = menuHeight + 'px'; + } } }, From 2019ad96def1bb5975b92d3dfe76c5af493a7644 Mon Sep 17 00:00:00 2001 From: pinturic Date: Thu, 5 Nov 2015 11:28:04 +0100 Subject: [PATCH 2/2] Update left-nav.jsx cleaned _updateMenuHeight variables declaration --- src/left-nav.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/left-nav.jsx b/src/left-nav.jsx index 72761f4c0faac5..a00ce427ba1daa 100644 --- a/src/left-nav.jsx +++ b/src/left-nav.jsx @@ -223,10 +223,10 @@ const LeftNav = React.createClass({ _updateMenuHeight() { if (this.props.header) { - let container = ReactDOM.findDOMNode(this.refs.clickAwayableElement); - let menu = ReactDOM.findDOMNode(this.refs.menuItems); + const menu = ReactDOM.findDOMNode(this.refs.menuItems); if (menu){ - let menuHeight = container.clientHeight - menu.offsetTop; + const container = ReactDOM.findDOMNode(this.refs.clickAwayableElement); + const menuHeight = container.clientHeight - menu.offsetTop; menu.style.height = menuHeight + 'px'; } }