Update code style

pull/175/head
afc163 10 years ago
parent 8274cce09e
commit 970aa4f846

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

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

@ -153,7 +153,7 @@
}
}
&-close{
&-close {
height: 0 !important;
opacity: 0 !important;
margin: 0;

Loading…
Cancel
Save