1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-26 17:54:52 +02:00

forgot to localize the hash fragment ids

This commit is contained in:
Pomax
2017-03-07 08:14:26 -08:00
parent aa7bd6290d
commit 9502fba768
10 changed files with 101 additions and 85 deletions

View File

@@ -5,11 +5,18 @@ var Link = ReactRouter.Link;
var sections = require("./sections");
var sectionPages = Object.keys(sections);
var SectionHeader = require("./SectionHeader.jsx");
var Navigation = React.createClass({
generateNavItem: function(name, entry) {
var Type = sections[name];
var title = Type.getDefaultProps().title;
var link = <a href={'#' + name}>{ title }</a>;
var locale = SectionHeader.locale;
if (typeof window !== undefined && window.location.toString().indexOf(locale) === -1) {
locale = '';
}
var fragmentid = `${locale ? './' + locale + '/': '.'}#${name}`;
var link = <a href={fragmentid}>{ title }</a>;
if (this.props.fullNav) {
link = <Link to={name}>{title}</Link>;
}
@@ -20,6 +27,7 @@ var Navigation = React.createClass({
generateNav: function() {
if (this.props.compact) return null;
return (
<div ref="navigation">
<navigation className={ this.props.compact ? "compact" : null }>