From f26bbc1cd5518cc0e41cfd10eaec519b8ba8d4ae Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 19 Oct 2015 17:57:33 +0800 Subject: [PATCH] Add document version switch in footer, #406 --- components/select/demo/size.md | 2 +- scripts/demo.js | 20 ++++++++++++++++++++ site/templates/footer.html | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/components/select/demo/size.md b/components/select/demo/size.md index 68a7df2fa0..79e8da4815 100644 --- a/components/select/demo/size.md +++ b/components/select/demo/size.md @@ -39,7 +39,7 @@ React.render( ```` ````css -.ant-select{ +.code-box-demo .ant-select { margin: 0 10px 10px 0; } ```` diff --git a/scripts/demo.js b/scripts/demo.js index c61efe29df..a672b20f46 100644 --- a/scripts/demo.js +++ b/scripts/demo.js @@ -48,4 +48,24 @@ InstantClickChangeFns.push(function () { React.render(, 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 ; + }); + function onChange(e) { + if (versionsHistory[e.target.value]) { + location.replace(versionsHistory[e.target.value]); + } + } + React.render(, document.getElementById('versions-select')) +}); + module.exports = antd; diff --git a/site/templates/footer.html b/site/templates/footer.html index 992422effb..09e5df1ca4 100644 --- a/site/templates/footer.html +++ b/site/templates/footer.html @@ -16,6 +16,7 @@
  • ©2015 蚂蚁金服体验技术部出品

    +

    文档版本: