mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
Slugify tab anchors. Closes #77.
This commit is contained in:
parent
a778f6c660
commit
8a8f157841
@ -8,19 +8,23 @@ var ArchiveFeatureComponent = React.createFactory(require('./components/feature/
|
||||
|
||||
var tabPanes = [
|
||||
{
|
||||
name: "Feature Toggles",
|
||||
name: 'Feature Toggles',
|
||||
slug: 'feature-toggles',
|
||||
content: new FeatureTogglesComponent({pollInterval: 5000})
|
||||
},
|
||||
{
|
||||
name: "Strategies",
|
||||
name: 'Strategies',
|
||||
slug: 'strategies',
|
||||
content: new StrategiesComponent({})
|
||||
},
|
||||
{
|
||||
name: "Log",
|
||||
slug: 'log',
|
||||
content: new LogEntriesComponent({})
|
||||
},
|
||||
{
|
||||
name: "Archive",
|
||||
slug: 'archive',
|
||||
content: new ArchiveFeatureComponent({})
|
||||
}
|
||||
];
|
||||
|
@ -12,7 +12,7 @@ var TabView = React.createClass({
|
||||
if(userHash) {
|
||||
userHash = userHash.split("#")[1];
|
||||
this.props.tabPanes.forEach(function(pane) {
|
||||
if(pane.name === userHash) {
|
||||
if(pane.slug === userHash) {
|
||||
activeTab = pane;
|
||||
}
|
||||
}.bind(this));
|
||||
@ -28,8 +28,8 @@ var TabView = React.createClass({
|
||||
render: function() {
|
||||
var tabNodes = this.props.tabPanes.map(function (tabPane) {
|
||||
return (
|
||||
<li key={tabPane.name} className={tabPane.name===this.state.activeTab.name ? "active": ""}>
|
||||
<a href={"#" + tabPane.name}
|
||||
<li key={tabPane.name} className={tabPane.name === this.state.activeTab.name ? "active": ""}>
|
||||
<a href={"#" + tabPane.slug}
|
||||
onClick={this.onChangeTab.bind(this, tabPane)}>{tabPane.name}
|
||||
</a>
|
||||
</li>
|
||||
|
Loading…
Reference in New Issue
Block a user