diff --git a/components/alert/index.jsx b/components/alert/index.jsx index 478dda5f7..525b12756 100644 --- a/components/alert/index.jsx +++ b/components/alert/index.jsx @@ -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 ? - + : ''; html =
@@ -82,16 +79,16 @@ export default React.createClass({ html =
{this.props.message} - {close} + {close}
; } } - return !this.state.closed ? - {html} - : null; + {html} + ; } }); diff --git a/components/tag/index.jsx b/components/tag/index.jsx index b4f21cafd..70972fcb2 100644 --- a/components/tag/index.jsx +++ b/components/tag/index.jsx @@ -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 :
- - {close} -
; + return (this.state.closed && !this.state.closing) ? null + :
+ + {close} +
; } } AntTag.defaultProps = { prefixCls: prefixCls, closable: false, - onClose: function () {} + onClose: function() {} }; export default AntTag; diff --git a/nico.js b/nico.js index c78510568..e4881bc9a 100644 --- a/nico.js +++ b/nico.js @@ -91,7 +91,7 @@ exports.middlewares = [ aggregateTimeout: 300, poll: true }, - quiet: true + noInfo: true }); try { return handler(req, res, next); diff --git a/package.json b/package.json index 73c6f598a..2e949b453 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/style/components/alert.less b/style/components/alert.less index 14de15ff4..118cfefa7 100644 --- a/style/components/alert.less +++ b/style/components/alert.less @@ -153,7 +153,7 @@ } } - &-close{ + &-close { height: 0 !important; opacity: 0 !important; margin: 0;