提交 4978cbe9 编写于 作者: A afc163

Add document version switch in footer, #406

上级 d12425a1
......@@ -39,7 +39,7 @@ React.render(
````
````css
.ant-select{
.code-box-demo .ant-select {
margin: 0 10px 10px 0;
}
````
......@@ -48,4 +48,24 @@ InstantClickChangeFns.push(function () {
React.render(<AutoComplete/>, document.getElementById('autoComplete'));
});
InstantClickChangeFns.push(function () {
var versionsHistory = {
'0.9.1': 'http://09x.ant.design'
};
versionsHistory[antdVersion.latest] =
versionsHistory[antdVersion.latest] || 'http://ant.design';
var options = Object.keys(versionsHistory).map(function(version) {
var link = versionsHistory[version];
return <option value={version}>{version}</option>;
});
function onChange(e) {
if (versionsHistory[e.target.value]) {
location.replace(versionsHistory[e.target.value]);
}
}
React.render(<select defaultValue={antdVersion.latest} onChange={onChange}>
{options}
</select>, document.getElementById('versions-select'))
});
module.exports = antd;
......@@ -16,6 +16,7 @@
</li>
<li>
<h3>©2015 蚂蚁金服体验技术部出品</h3>
<h3>文档版本:<span id="versions-select"></span></h3>
</li>
</ul>
</footer>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册