Browse Source

Merge branch '1.x-stable'

pull/2378/head
afc163 8 years ago
parent
commit
aee2b2c5ad
  1. 8
      components/tree/demo/basic-controlled.md
  2. 2
      components/tree/demo/basic.md
  3. 4
      components/tree/demo/draggable.md
  4. 2
      components/tree/demo/dynamic.md
  5. 3
      components/tree/style/index.less
  6. 2
      components/tree/style/mixin.less
  7. 8
      site/theme/template/Content/MainContent.jsx
  8. 7
      site/theme/template/Home/index.jsx

8
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 <TreeNode key={item.key} title={item.key} />;
});
return (
<Tree checkable multiple={this.props.multiple}
<Tree
checkable
onExpand={this.onExpand} expandedKeys={this.state.expandedKeys}
autoExpandParent={this.state.autoExpandParent}
onCheck={this.onCheck} checkedKeys={this.state.checkedKeys}

2
components/tree/demo/basic.md

@ -31,7 +31,7 @@ const Demo = React.createClass({
},
render() {
return (
<Tree className="myCls" showLine multiple checkable
<Tree className="myCls" showLine checkable
defaultExpandedKeys={this.state.defaultExpandedKeys}
defaultSelectedKeys={this.state.defaultSelectedKeys}
defaultCheckedKeys={this.state.defaultCheckedKeys}

4
components/tree/demo/draggable.md

@ -99,7 +99,9 @@ const Demo = React.createClass({
return <TreeNode key={item.key} title={item.key} />;
});
return (
<Tree defaultExpandedKeys={this.state.expandedKeys} openAnimation={{}} draggable
<Tree
defaultExpandedKeys={this.state.expandedKeys}
draggable
onDragEnter={this.onDragEnter}
onDrop={this.onDrop}
>

2
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() {

3
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 {

2
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;

8
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 ||

7
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 `

Loading…
Cancel
Save