2015-10-19 19:50:55 +08:00
|
|
|
<script>
|
2016-04-27 17:03:17 +08:00
|
|
|
var prefix = /^\/components/.test(location.pathname) ? location.pathname.replace(/^\//, '').split('/').join('-') : '';
|
2016-05-11 01:48:05 +08:00
|
|
|
var scrollToString = location.hash ? '?scrollTo=' + prefix + location.hash : '';
|
2016-05-10 19:08:46 +08:00
|
|
|
if (location.pathname === '/changelog') {
|
2016-05-11 01:48:05 +08:00
|
|
|
location.href = '/#/docs/react/changelog' + scrollToString;
|
2016-05-10 19:08:46 +08:00
|
|
|
} else {
|
2016-05-11 14:39:21 +08:00
|
|
|
location.href = '/#' + location.pathname.replace(/\/$/, '') + scrollToString;
|
2016-05-10 19:08:46 +08:00
|
|
|
}
|
2015-10-19 19:50:55 +08:00
|
|
|
</script>
|