diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-03-29 13:08:57 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-03-29 15:18:48 -0400 |
commit | 355b0d61ae3cd5709b4a90789e0254b9d4710b9d (patch) | |
tree | e990caf2f1b17b49ba637dcc77b4be0d030f8f27 | |
parent | 4029db3905de46e00face17e3d05d03abb1f433a (diff) | |
download | chat-355b0d61ae3cd5709b4a90789e0254b9d4710b9d.tar.gz chat-355b0d61ae3cd5709b4a90789e0254b9d4710b9d.tar.bz2 chat-355b0d61ae3cd5709b4a90789e0254b9d4710b9d.zip |
Removed expand widget from the backstage sidebar and changed how the sections highlight
-rw-r--r-- | webapp/components/backstage/backstage_section.jsx | 46 |
1 files changed, 2 insertions, 44 deletions
diff --git a/webapp/components/backstage/backstage_section.jsx b/webapp/components/backstage/backstage_section.jsx index 41ce766bd..d6ce2b258 100644 --- a/webapp/components/backstage/backstage_section.jsx +++ b/webapp/components/backstage/backstage_section.jsx @@ -30,59 +30,17 @@ export default class BackstageSection extends React.Component { }; } - constructor(props) { - super(props); - - this.handleClick = this.handleClick.bind(this); - - this.state = { - expanded: true - }; - } - getLink() { return this.props.parentLink + '/' + this.props.name; } - isActive() { - const link = this.getLink(); - - return this.context.router.isActive(link); - } - - handleClick(e) { - if (this.isActive()) { - // we're already on this page so just toggle the link - e.preventDefault(); - - this.setState({ - expanded: !this.state.expanded - }); - } - - // otherwise, just follow the link - } - render() { const {title, subsection, children} = this.props; const link = this.getLink(); - const active = this.isActive(); - - // act like docs.mattermost.com and only expand if this link is active - const expanded = active && this.state.expanded; - - let toggle = null; - if (children.length > 0) { - if (expanded) { - toggle = <i className='fa fa-minus-square-o'/>; - } else { - toggle = <i className='fa fa-plus-square-o'/>; - } - } let clonedChildren = null; - if (children.length > 0 && expanded) { + if (children.length > 0) { clonedChildren = ( <ul className='subsections'> { @@ -107,10 +65,10 @@ export default class BackstageSection extends React.Component { <Link className={`${className}-title`} activeClassName={`${className}-title--active`} + onlyActiveOnIndex={true} onClick={this.handleClick} to={link} > - {toggle} <span className={`${className}-title__text`}> {title} </span> |