Skip to content

Commit 552c37e

Browse files
committed
Merge remote-tracking branch 'upstream/master'
# Conflicts: # dist/react-tooltip.js # dist/react-tooltip.min.js # standalone/react-tooltip.js # standalone/react-tooltip.min.js
2 parents 433e0d4 + f510164 commit 552c37e

File tree

7 files changed

+13
-36
lines changed

7 files changed

+13
-36
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## Change Log
22

3+
### 2.0.2 (2016/05/19 10:01 +00:00)
4+
- [#104](https://github.com/wwayne/react-tooltip/pull/104) Ensure data-html is converted to bool type (@antoniodgonzalez)
5+
36
### 2.0.1 (2016/05/14 00:32 +00:00)
47
- [#102](https://github.com/wwayne/react-tooltip/pull/102) Clear hide timeout on component unmount (@oluckyman)
58
- [#100](https://github.com/wwayne/react-tooltip/pull/100) correct spelling error (@SashaBayan)

dist/react-tooltip.js

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ var ReactTooltip = function (_Component) {
101101
delayHide: 0,
102102
delayShow: 0,
103103
event: props.event || null,
104-
eventOff: props.eventOff || null,
105104
isCapture: props.isCapture || false
106105
};
107106
_this.delayShowLoop = null;
@@ -172,25 +171,14 @@ var ReactTooltip = function (_Component) {
172171
var targetArray = this.getTargetArray();
173172

174173
var dataEvent = void 0;
175-
var dataEventOff = void 0;
176174
for (var i = 0; i < targetArray.length; i++) {
177175
if (targetArray[i].getAttribute('currentItem') === null) {
178176
targetArray[i].setAttribute('currentItem', 'false');
179177
}
180178
dataEvent = this.state.event || targetArray[i].getAttribute('data-event');
181179
if (dataEvent) {
182-
dataEventOff = this.state.eventOff || targetArray[i].getAttribute('data-event-off');
183-
// if off event is specified, we will show tip on data-event and hide it on data-event-off
184-
if (dataEventOff) {
185-
targetArray[i].removeEventListener(dataEvent, this.showTooltip);
186-
targetArray[i].addEventListener(dataEvent, this.showTooltip, false);
187-
188-
targetArray[i].removeEventListener(dataEventOff, this.hideTooltip);
189-
targetArray[i].addEventListener(dataEventOff, this.hideTooltip, false);
190-
} else {
191-
targetArray[i].removeEventListener(dataEvent, this.checkStatus);
192-
targetArray[i].addEventListener(dataEvent, this.checkStatus, false);
193-
}
180+
targetArray[i].removeEventListener(dataEvent, this.checkStatus);
181+
targetArray[i].addEventListener(dataEvent, this.checkStatus, false);
194182
} else {
195183
targetArray[i].removeEventListener('mouseenter', this.showTooltip);
196184
targetArray[i].addEventListener('mouseenter', this.showTooltip, false);
@@ -356,7 +344,7 @@ var ReactTooltip = function (_Component) {
356344
type: e.currentTarget.getAttribute('data-type') || this.props.type || 'dark',
357345
effect: e.currentTarget.getAttribute('data-effect') || this.props.effect || 'float',
358346
offset: e.currentTarget.getAttribute('data-offset') || this.props.offset || {},
359-
html: e.currentTarget.getAttribute('data-html') || this.props.html || false,
347+
html: e.currentTarget.getAttribute('data-html') === 'true' || this.props.html || false,
360348
delayShow: e.currentTarget.getAttribute('data-delay-show') || this.props.delayShow || 0,
361349
delayHide: e.currentTarget.getAttribute('data-delay-hide') || this.props.delayHide || 0,
362350
border: e.currentTarget.getAttribute('data-border') === 'true' || this.props.border || false,
@@ -769,7 +757,6 @@ ReactTooltip.propTypes = {
769757
delayHide: _react.PropTypes.number,
770758
delayShow: _react.PropTypes.number,
771759
event: _react.PropTypes.any,
772-
eventOff: _react.PropTypes.any,
773760
watchWindow: _react.PropTypes.bool,
774761
isCapture: _react.PropTypes.bool
775762
};

dist/react-tooltip.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-tooltip",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"description": "react tooltip component",
55
"main": "index.js",
66
"scripts": {

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ class ReactTooltip extends Component {
279279
type: e.currentTarget.getAttribute('data-type') || this.props.type || 'dark',
280280
effect: e.currentTarget.getAttribute('data-effect') || this.props.effect || 'float',
281281
offset: e.currentTarget.getAttribute('data-offset') || this.props.offset || {},
282-
html: e.currentTarget.getAttribute('data-html') || this.props.html || false,
282+
html: e.currentTarget.getAttribute('data-html') === 'true' || this.props.html || false,
283283
delayShow: e.currentTarget.getAttribute('data-delay-show') || this.props.delayShow || 0,
284284
delayHide: e.currentTarget.getAttribute('data-delay-hide') || this.props.delayHide || 0,
285285
border: e.currentTarget.getAttribute('data-border') === 'true' || this.props.border || false,

standalone/react-tooltip.js

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ var ReactTooltip = function (_Component) {
153153
delayHide: 0,
154154
delayShow: 0,
155155
event: props.event || null,
156-
eventOff: props.eventOff || null,
157156
isCapture: props.isCapture || false
158157
};
159158
_this.delayShowLoop = null;
@@ -224,25 +223,14 @@ var ReactTooltip = function (_Component) {
224223
var targetArray = this.getTargetArray();
225224

226225
var dataEvent = void 0;
227-
var dataEventOff = void 0;
228226
for (var i = 0; i < targetArray.length; i++) {
229227
if (targetArray[i].getAttribute('currentItem') === null) {
230228
targetArray[i].setAttribute('currentItem', 'false');
231229
}
232230
dataEvent = this.state.event || targetArray[i].getAttribute('data-event');
233231
if (dataEvent) {
234-
dataEventOff = this.state.eventOff || targetArray[i].getAttribute('data-event-off');
235-
// if off event is specified, we will show tip on data-event and hide it on data-event-off
236-
if (dataEventOff) {
237-
targetArray[i].removeEventListener(dataEvent, this.showTooltip);
238-
targetArray[i].addEventListener(dataEvent, this.showTooltip, false);
239-
240-
targetArray[i].removeEventListener(dataEventOff, this.hideTooltip);
241-
targetArray[i].addEventListener(dataEventOff, this.hideTooltip, false);
242-
} else {
243-
targetArray[i].removeEventListener(dataEvent, this.checkStatus);
244-
targetArray[i].addEventListener(dataEvent, this.checkStatus, false);
245-
}
232+
targetArray[i].removeEventListener(dataEvent, this.checkStatus);
233+
targetArray[i].addEventListener(dataEvent, this.checkStatus, false);
246234
} else {
247235
targetArray[i].removeEventListener('mouseenter', this.showTooltip);
248236
targetArray[i].addEventListener('mouseenter', this.showTooltip, false);
@@ -408,7 +396,7 @@ var ReactTooltip = function (_Component) {
408396
type: e.currentTarget.getAttribute('data-type') || this.props.type || 'dark',
409397
effect: e.currentTarget.getAttribute('data-effect') || this.props.effect || 'float',
410398
offset: e.currentTarget.getAttribute('data-offset') || this.props.offset || {},
411-
html: e.currentTarget.getAttribute('data-html') || this.props.html || false,
399+
html: e.currentTarget.getAttribute('data-html') === 'true' || this.props.html || false,
412400
delayShow: e.currentTarget.getAttribute('data-delay-show') || this.props.delayShow || 0,
413401
delayHide: e.currentTarget.getAttribute('data-delay-hide') || this.props.delayHide || 0,
414402
border: e.currentTarget.getAttribute('data-border') === 'true' || this.props.border || false,
@@ -821,7 +809,6 @@ ReactTooltip.propTypes = {
821809
delayHide: _react.PropTypes.number,
822810
delayShow: _react.PropTypes.number,
823811
event: _react.PropTypes.any,
824-
eventOff: _react.PropTypes.any,
825812
watchWindow: _react.PropTypes.bool,
826813
isCapture: _react.PropTypes.bool
827814
};

standalone/react-tooltip.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)