rc-trigger
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -38,3 +38,2 @@ 'use strict'; | ||
onMouseEnter: _react.PropTypes.func, | ||
onAnimateLeave: _react.PropTypes.func, | ||
className: _react.PropTypes.string, | ||
@@ -58,6 +57,2 @@ onMouseLeave: _react.PropTypes.func | ||
onAnimateLeave: function onAnimateLeave() { | ||
this.props.onAnimateLeave(); | ||
}, | ||
getPopupDomNode: function getPopupDomNode() { | ||
@@ -95,2 +90,3 @@ return _reactDom2['default'].findDOMNode(this); | ||
var prefixCls = props.prefixCls; | ||
var destroyPopupOnHide = props.destroyPopupOnHide; | ||
@@ -102,2 +98,28 @@ var className = this.getClassName(this.currentAlignClassName || props.getClassNameFromAlign(align)); | ||
} | ||
if (destroyPopupOnHide) { | ||
return _react2['default'].createElement( | ||
_rcAnimate2['default'], | ||
{ component: '', | ||
exclusive: true, | ||
transitionAppear: true, | ||
transitionName: this.getTransitionName() }, | ||
visible ? _react2['default'].createElement( | ||
_rcAlign2['default'], | ||
{ target: this.getTarget, | ||
key: 'popup', | ||
monitorWindowResize: true, | ||
align: align, | ||
onAlign: this.onAlign }, | ||
_react2['default'].createElement( | ||
_PopupInner2['default'], | ||
{ className: className, | ||
visible: true, | ||
onMouseEnter: props.onMouseEnter, | ||
onMouseLeave: props.onMouseLeave, | ||
style: style }, | ||
props.children | ||
) | ||
) : null | ||
); | ||
} | ||
return _react2['default'].createElement( | ||
@@ -108,3 +130,2 @@ _rcAnimate2['default'], | ||
transitionAppear: true, | ||
onLeave: this.onAnimateLeave, | ||
transitionName: this.getTransitionName(), | ||
@@ -111,0 +132,0 @@ showProp: 'xVisible' }, |
@@ -210,9 +210,2 @@ 'use strict'; | ||
onAnimateLeave: function onAnimateLeave() { | ||
if (this.props.destroyPopupOnHide) { | ||
_reactDom2['default'].unmountComponentAtNode(this.getPopupContainer()); | ||
this.popupDomNode = null; | ||
} | ||
}, | ||
onDocumentClick: function onDocumentClick(event) { | ||
@@ -284,2 +277,3 @@ var target = event.target; | ||
_extends({ prefixCls: props.prefixCls, | ||
destroyPopupOnHide: props.destroyPopupOnHide, | ||
visible: state.popupVisible, | ||
@@ -290,3 +284,2 @@ className: props.popupClassName, | ||
animation: props.popupAnimation, | ||
onAnimateLeave: this.onAnimateLeave, | ||
getClassNameFromAlign: this.getPopupClassNameFromAlign | ||
@@ -293,0 +286,0 @@ }, mouseProps, { |
{ | ||
"name": "rc-trigger", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "base abstract trigger component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -70,3 +70,3 @@ # rc-trigger | ||
<a href='#'>hover</a> | ||
</Tooltip>, container); | ||
</Trigger>, container); | ||
``` | ||
@@ -73,0 +73,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28324
600