From ce51768facffaa5637681e6e1ead8cafed0630f5 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 13 Jul 2016 14:16:15 +0800 Subject: [PATCH 1/4] remove unused code --- site/theme/template/Home/index.jsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/site/theme/template/Home/index.jsx b/site/theme/template/Home/index.jsx index 0cd970f64e..3dc169dfbf 100644 --- a/site/theme/template/Home/index.jsx +++ b/site/theme/template/Home/index.jsx @@ -17,13 +17,6 @@ export function collect(nextProps, callback) { } export default class Home extends React.Component { - componentWillMount() { - if (location.hash) { - const pathname = location.hash.replace(/^#/, '').replace('?scrollTo=', '#'); - location.href = pathname; - } - } - // To store style which is only for Home and has conflicts with others. getStyle() { return ` From 1c87f36dd4801fc4cac86bfe9eef72dcbf8a2f59 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 13 Jul 2016 16:06:07 +0800 Subject: [PATCH 2/4] Fix chrome hash link --- site/theme/template/Content/MainContent.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/site/theme/template/Content/MainContent.jsx b/site/theme/template/Content/MainContent.jsx index f54d4ce64c..77b738bd7f 100644 --- a/site/theme/template/Content/MainContent.jsx +++ b/site/theme/template/Content/MainContent.jsx @@ -17,10 +17,16 @@ export default class MainContent extends React.Component { document.body.scrollTop = 0; document.documentElement.scrollTop = 0; } else { - location.hash = location.hash; + this.timer = setTimeout(() => { + document.getElementById(location.hash.replace('#', '')).scrollIntoView(); + }, 10); } } + componentWillUnmount() { + clearTimeout(this.timer); + } + shouldComponentUpdate(nextProps) { const pathname = this.props.location.pathname; return pathname !== nextProps.location.pathname || From 2d0b56a4299d7ba81b91b83c92f07dc0f8571b79 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 13 Jul 2016 16:08:10 +0800 Subject: [PATCH 3/4] update tree demo --- components/tree/demo/basic-controlled.md | 8 ++------ components/tree/demo/basic.md | 2 +- components/tree/demo/draggable.md | 4 +++- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/components/tree/demo/basic-controlled.md b/components/tree/demo/basic-controlled.md index af9966b5f6..297cfa5a9e 100644 --- a/components/tree/demo/basic-controlled.md +++ b/components/tree/demo/basic-controlled.md @@ -38,11 +38,6 @@ const generateData = (_level, _preKey, _tns) => { generateData(z); const Demo = React.createClass({ - getDefaultProps() { - return { - multiple: true, - }; - }, getInitialState() { return { expandedKeys: ['0-0-0', '0-0-1'], @@ -82,7 +77,8 @@ const Demo = React.createClass({ return ; }); return ( - ; }); return ( - From 8c9af24d72cf46aff5f11a330a1bae7cf5d62747 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 13 Jul 2016 16:12:44 +0800 Subject: [PATCH 4/4] fix some tree style --- components/tree/demo/dynamic.md | 2 +- components/tree/style/index.less | 3 +-- components/tree/style/mixin.less | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/components/tree/demo/dynamic.md b/components/tree/demo/dynamic.md index 0fc1e3f391..ef65e8f718 100644 --- a/components/tree/demo/dynamic.md +++ b/components/tree/demo/dynamic.md @@ -80,7 +80,7 @@ const Demo = React.createClass({ getNewTreeData(treeData, treeNode.props.eventKey, generateTreeNodes(treeNode), 2); this.setState({ treeData }); resolve(); - }, 500); + }, 1000); }); }, render() { diff --git a/components/tree/style/index.less b/components/tree/style/index.less index 631d98c894..2b59f4b18b 100644 --- a/components/tree/style/index.less +++ b/components/tree/style/index.less @@ -91,9 +91,8 @@ content: '\e6a1'; display: inline-block; font-family: 'anticon'; - font-weight: bold; animation: loadingCircle 1s infinite linear; - margin-top: 8px; + color: @primary-color; } } &.@{tree-prefix-cls}-switcher { diff --git a/components/tree/style/mixin.less b/components/tree/style/mixin.less index 111f97f079..cc26a692a5 100644 --- a/components/tree/style/mixin.less +++ b/components/tree/style/mixin.less @@ -9,7 +9,7 @@ font-family: 'anticon'; font-weight: bold; position: absolute; - top: 0; + top: 1px; right: 4px; color: #666; transition: transform .3s ease;