mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 03:29:59 +08:00
Merge branch '1.x-stable'
This commit is contained in:
commit
aee2b2c5ad
@ -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}
|
||||
|
@ -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}
|
||||
|
@ -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}
|
||||
>
|
||||
|
@ -80,7 +80,7 @@ const Demo = React.createClass({
|
||||
getNewTreeData(treeData, treeNode.props.eventKey, generateTreeNodes(treeNode), 2);
|
||||
this.setState({ treeData });
|
||||
resolve();
|
||||
}, 500);
|
||||
}, 1000);
|
||||
});
|
||||
},
|
||||
render() {
|
||||
|
@ -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 {
|
||||
|
@ -9,7 +9,7 @@
|
||||
font-family: 'anticon';
|
||||
font-weight: bold;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
top: 1px;
|
||||
right: 4px;
|
||||
color: #666;
|
||||
transition: transform .3s ease;
|
||||
|
@ -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 ||
|
||||
|
@ -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…
Reference in New Issue
Block a user