Merge branch '0.8.0' of github.com:ant-design/ant-design into 0.8.0

This commit is contained in:
jljsj
2015-08-20 14:58:33 +08:00
5 changed files with 17 additions and 20 deletions
+7 -10
View File
@@ -1,5 +1,4 @@
import React from 'react';
import { animationEndEvent, addEventListenerOnce } from '../util/index';
import Animate from 'rc-animate';
export default React.createClass({
@@ -16,10 +15,9 @@ export default React.createClass({
},
handleClose(e) {
let dom = React.findDOMNode(this);
dom.style.height = dom.offsetHeight + 'px';
// Magic code
// 重复是去除浏览器渲染bug
// 重复一次后才能正确设置 height
dom.style.height = dom.offsetHeight + 'px';
this.setState({
@@ -29,7 +27,7 @@ export default React.createClass({
this.props.onClose.call(this, e);
}
},
animationEnd(){
animationEnd() {
this.setState({
closed: true,
closing: true
@@ -58,8 +56,7 @@ export default React.createClass({
if (this.props.description) {
let close = this.props.closable ?
<a onClick={this.handleClose} className={'ant-alert-with-description-close-icon'}>
<span
className='ant-alert-with-description-close-icon-x'></span>
<span className='ant-alert-with-description-close-icon-x'></span>
</a> : '';
html = <div data-show={this.state.closing} className={'ant-alert-with-description ant-alert-with-description-' + this.props.type + closeName}>
<i className={'anticon ' + iconClass}></i>
@@ -82,16 +79,16 @@ export default React.createClass({
html = <div data-show={this.state.closing} className={'ant-alert ant-alert-' + this.props.type + closeName}>
<i className={'anticon ' + iconClass}></i>
<span className={'ant-alert-description'}>{this.props.message}</span>
{close}
{close}
</div>;
}
}
return !this.state.closed ? <Animate
return this.state.closed ? null : <Animate
component=""
showProp='data-show'
transitionName="slide-up"
onEnd={this.animationEnd}>
{html}
</Animate> : null;
{html}
</Animate>;
}
});
+7 -7
View File
@@ -15,8 +15,7 @@ class AntTag extends React.Component {
close(e) {
let dom = React.findDOMNode(this);
dom.style.width = dom.offsetWidth + 'px';
// Magic code
// 重复是去除浏览器渲染bug
// It's Magic Code, don't know why
dom.style.width = dom.offsetWidth + 'px';
this.setState({
closing: true
@@ -38,17 +37,18 @@ class AntTag extends React.Component {
let className = this.props.prefixCls + ' ' + colorClass;
className = this.state.closing ? className + ' ' + this.props.prefixCls + '-close' : className;
return (this.state.closed && !this.state.closing) ? null : <div className={className}>
<a className={this.props.prefixCls + '-text'} {...this.props} />
{close}
</div>;
return (this.state.closed && !this.state.closing) ? null
: <div className={className}>
<a className={this.props.prefixCls + '-text'} {...this.props} />
{close}
</div>;
}
}
AntTag.defaultProps = {
prefixCls: prefixCls,
closable: false,
onClose: function () {}
onClose: function() {}
};
export default AntTag;
+1 -1
View File
@@ -91,7 +91,7 @@ exports.middlewares = [
aggregateTimeout: 300,
poll: true
},
quiet: true
noInfo: true
});
try {
return handler(req, res, next);
+1 -1
View File
@@ -62,7 +62,7 @@
"rc-util": "~2.0.3",
"react-slick2": "~0.6.6",
"reqwest": "~2.0.1",
"rc-animate": "^1.1.0"
"rc-animate": "~1.1.0"
},
"devDependencies": {
"autoprefixer-loader": "~2.0.0",
+1 -1
View File
@@ -153,7 +153,7 @@
}
}
&-close{
&-close {
height: 0 !important;
opacity: 0 !important;
margin: 0;