diff --git a/web/client/components/share/ShareEmbed.jsx b/web/client/components/share/ShareEmbed.jsx index 5ee585fb4a..8ea237836b 100644 --- a/web/client/components/share/ShareEmbed.jsx +++ b/web/client/components/share/ShareEmbed.jsx @@ -24,10 +24,23 @@ require('./share.css'); const ShareEmbed = React.createClass({ propTypes: { - shareUrl: React.PropTypes.string + shareUrl: React.PropTypes.string, + showTOCToggle: React.PropTypes.bool }, - getInitialState() { - return {copied: false, forceDrawer: false}; + getInitialState() { + return {copied: false, forceDrawer: false}; + }, + getDefaultProps() { + return { + showTOCToggle: true + }; + }, + renderTools() { + if (this.props.showTOCToggle) { + return ( this.setState({forceDrawer: !this.state.forceDrawer})}> + + ); + } }, render() { @@ -44,16 +57,12 @@ const ShareEmbed = React.createClass({ ); return (
- -

- this.setState({forceDrawer: !this.state.forceDrawer})}> - - + {this.renderTools()}