mirror of
https://github.com/Pomax/BezierInfo-2.git
synced 2025-08-17 06:04:31 +02:00
forgot to localize the hash fragment ids
This commit is contained in:
@@ -1,10 +1,19 @@
|
||||
var React = require("react");
|
||||
|
||||
var SectionHeader = React.createClass({
|
||||
statics: {
|
||||
locale: ''
|
||||
},
|
||||
|
||||
render: function() {
|
||||
var locale = SectionHeader.locale;
|
||||
if (typeof window !== undefined && window.location.toString().indexOf(locale) === -1) {
|
||||
locale = '';
|
||||
}
|
||||
var fragmentid = `${locale ? './' + locale + '/': '.'}#${this.props.name}`;
|
||||
return (
|
||||
<h2 id={this.props.name} data-num={this.props.number}>
|
||||
<a href={'#' + this.props.name}>{this.props.title}</a>
|
||||
<a href={fragmentid}>{this.props.title}</a>
|
||||
</h2>
|
||||
);
|
||||
},
|
||||
|
Reference in New Issue
Block a user