Merge branch '1.x-stable'

This commit is contained in:
afc163 2016-07-13 16:26:27 +08:00
commit aee2b2c5ad
8 changed files with 16 additions and 20 deletions

View File

@ -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}

View File

@ -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}

View File

@ -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}
>

View File

@ -80,7 +80,7 @@ const Demo = React.createClass({
getNewTreeData(treeData, treeNode.props.eventKey, generateTreeNodes(treeNode), 2);
this.setState({ treeData });
resolve();
}, 500);
}, 1000);
});
},
render() {

View File

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

View File

@ -9,7 +9,7 @@
font-family: 'anticon';
font-weight: bold;
position: absolute;
top: 0;
top: 1px;
right: 4px;
color: #666;
transition: transform .3s ease;

View File

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

View File

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