Skip to content

Commit

Permalink
ui: Add "current node highlight" in nav
Browse files Browse the repository at this point in the history
  • Loading branch information
rbarrois committed Jul 7, 2015
1 parent 2ec13b5 commit 2926cb5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion ui/app/views/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ var AppView = React.createClass({
];
var styles = this.getStyles();

var currentItem = null;
for (var i = menuItems.length - 1; i >= 0; i--) {
if (this.context.router.isActive(menuItems[i].route)) {
currentItem = i;
break;
}
}

return (
<mui.AppCanvas predefinedLayout={1}>
<mui.AppBar title="Demo" zDepth={0} showMenuIconButton={false} />
Expand All @@ -94,7 +102,11 @@ var AppView = React.createClass({
<RouteHandler/>
</div>
<div style={styles.nav}>
<mui.Menu menuItems={menuItems} onItemClick={this.onNavChange} />
<mui.Menu
menuItems={menuItems}
selectedIndex={currentItem}
onItemClick={this.onNavChange}
/>
</div>
</div>
</mui.AppCanvas>
Expand Down

0 comments on commit 2926cb5

Please sign in to comment.