rc-tooltip
Advanced tools
Comparing version 2.2.4 to 2.3.0
# History | ||
---- | ||
### 2.3.0 / 2015-07-07 | ||
`new` [#7](https://github.com/react-component/tooltip/issues/7) support delay prop | ||
### 2.2.0 / 2015-06-30 | ||
@@ -5,0 +9,0 @@ |
@@ -113,10 +113,28 @@ 'use strict'; | ||
}, { | ||
key: 'delaySetVisible', | ||
value: function delaySetVisible(visible, e) { | ||
var _this2 = this; | ||
var delay = this.props.delay * 1000; | ||
if (delay && e && e.type.indexOf('mouse') !== -1) { | ||
if (this.delayTimer) { | ||
clearTimeout(this.delayTimer); | ||
} | ||
this.delayTimer = setTimeout(function () { | ||
_this2.setVisible(visible); | ||
_this2.delayTimer = null; | ||
}, delay); | ||
} else { | ||
this.setVisible(visible); | ||
} | ||
} | ||
}, { | ||
key: 'show', | ||
value: function show() { | ||
this.setVisible(true); | ||
value: function show(e) { | ||
this.delaySetVisible(true, e); | ||
} | ||
}, { | ||
key: 'hide', | ||
value: function hide() { | ||
this.setVisible(false); | ||
value: function hide(e) { | ||
this.delaySetVisible(false, e); | ||
} | ||
@@ -197,3 +215,4 @@ }, { | ||
overlayStyle: React.PropTypes.object, | ||
wrapStyle: React.PropTypes.object | ||
wrapStyle: React.PropTypes.object, | ||
delay: React.PropTypes.number | ||
}; | ||
@@ -205,2 +224,3 @@ | ||
onVisibleChange: function onVisibleChange() {}, | ||
delay: 0, | ||
overlayStyle: {}, | ||
@@ -207,0 +227,0 @@ wrapStyle: {}, |
{ | ||
"name": "rc-tooltip", | ||
"version": "2.2.4", | ||
"version": "2.3.0", | ||
"description": "tooltip ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -72,2 +72,8 @@ # rc-tooltip | ||
<tr> | ||
<td>delay</td> | ||
<td>number</td> | ||
<td></td> | ||
<td>delay time to show or hide, only valid for hover trigger.unit: s.</td> | ||
</tr> | ||
<tr> | ||
<td>overlayStyle</td> | ||
@@ -74,0 +80,0 @@ <td>Object</td> |
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
25728
535
159