Skip to content
This repository was archived by the owner on Mar 7, 2018. It is now read-only.

Commit

Permalink
Clean up leftover mode toggling code in NavBarNew.js
Browse files Browse the repository at this point in the history
  • Loading branch information
strbean committed Jun 30, 2016
1 parent 28bc012 commit 6a4b9c1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 0 additions & 10 deletions js/NavBarNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ var NavBarNew = React.createClass({
showModal: false,
}
},
getModeName: function (name) {
return {'research_mode': 'Research Pages', 'default': 'Default Mode'}[name]
},
toggleMode: function () {
this.props.toggleMode();
this.setState({ showModal: false });
},
shouldComponentUpdate: function (nextProps, nextState) {
// Only rerender if path has change or the research mode changes, ignoring query.
var d3TipDiv = document.getElementsByClassName('d3-tip-selection');
Expand All @@ -51,7 +44,6 @@ var NavBarNew = React.createClass({
}
return this.props.mode !== nextProps.mode ||
this.state.loggedin !== nextState.loggedin ||
this.state.showModal !== nextState.showModal ||
this.props.path.split(/\?/)[0] !== nextProps.path.split(/\?/)[0];
},
activePath: function (path, tab) {
Expand All @@ -68,8 +60,6 @@ var NavBarNew = React.createClass({
</h1>
{this.props.mode === 'research_mode' && <span id="research-label" className="label label-info">Research</span>}
</a>);
var mode_name = this.getModeName(this.props.mode);
var other_mode = (this.props.mode === 'research_mode') ? 'default' : 'research_mode';
return (
<div className="navbar-container">
<Navbar fixedTop brand={brand} toggleNavKey={0}>
Expand Down
2 changes: 1 addition & 1 deletion js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ var Application = React.createClass({
var path = this.getPath().slice(1);
return (
<div>
<NavBarNew path={path} mode={this.state.mode} toggleMode={this.onChildToggleMode}/>
<NavBarNew path={path} mode={this.state.mode} />
<RouteHandler />
<Database
mode={this.state.mode}
Expand Down

0 comments on commit 6a4b9c1

Please sign in to comment.