Skip to content

Commit 1ebb058

Browse files
committed
3.2.2
1 parent c20d5b1 commit 1ebb058

File tree

4 files changed

+83
-72
lines changed

4 files changed

+83
-72
lines changed

CHANGELOG.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
## Change Log
22

3-
### 3.2.1 (2016/09/30 09:50 +00:00)
3+
### 3.2.2 (2016/11/23 08:22 +00:00)
4+
- [#220](https://github.com/wwayne/react-tooltip/pull/220) Use parameter 'useCapture' for remove listener if it is registered as… (@achernetsky)
5+
- [#223](https://github.com/wwayne/react-tooltip/pull/223) Fix/security csp style src (@briantrice)
6+
- [#216](https://github.com/wwayne/react-tooltip/pull/216) Fix fire of global show event for IE (@SubVersive)
7+
8+
### 3.2.1 (2016/09/30 09:51 +00:00)
49
- [#202](https://github.com/wwayne/react-tooltip/pull/202) Hide tooltip when getContent return null or undefined, same for empty… (@wwayne)
510
- [#201](https://github.com/wwayne/react-tooltip/pull/201) Hide tooltip if the tip is empty or disabled (@wwayne)
611

@@ -94,7 +99,7 @@
9499
### v1.1.2 (2016/02/15 12:31 +00:00)
95100
- [#79](https://github.com/wwayne/react-tooltip/pull/79) Require the non-minified dist build in index (@idan)
96101
- [#73](https://github.com/wwayne/react-tooltip/pull/73) Clear timeout when unmounting. (@joelburget)
97-
- [#72](https://github.com/wwayne/react-tooltip/pull/72) clearing delayShowLoop-Timeout when component will unmount (@Monterra)
102+
- [#72](https://github.com/wwayne/react-tooltip/pull/72) clearing delayShowLoop-Timeout when component will unmount (@dsumer)
98103

99104
### v1.0.0 (2016/01/10 02:16 +00:00)
100105
- [#68](https://github.com/wwayne/react-tooltip/pull/68) better fix for Maximum call stack size exceeded (@enjalot)

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-tooltip",
3-
"version": "3.2.1",
3+
"version": "3.2.2",
44
"description": "react tooltip component",
55
"main": "dist/index.js",
66
"scripts": {

standalone/react-tooltip.js

+73-66
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ exports.default = function (target) {
8181
target.prototype.customBindListener = function (ele) {
8282
var _this = this;
8383

84-
var _state = this.state,
85-
event = _state.event,
86-
eventOff = _state.eventOff;
84+
var _state = this.state;
85+
var event = _state.event;
86+
var eventOff = _state.eventOff;
8787

8888
var dataEvent = ele.getAttribute('data-event') || event;
8989
var dataEventOff = ele.getAttribute('data-event-off') || eventOff;
@@ -103,9 +103,9 @@ exports.default = function (target) {
103103

104104
/* Unbind listener for custom event */
105105
target.prototype.customUnbindListener = function (ele) {
106-
var _state2 = this.state,
107-
event = _state2.event,
108-
eventOff = _state2.eventOff;
106+
var _state2 = this.state;
107+
var event = _state2.event;
108+
var eventOff = _state2.eventOff;
109109

110110
var dataEvent = event || ele.getAttribute('data-event');
111111
var dataEventOff = eventOff || ele.getAttribute('data-event-off');
@@ -421,9 +421,9 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
421421
}, {
422422
key: 'componentDidMount',
423423
value: function componentDidMount() {
424-
var _props = this.props,
425-
insecure = _props.insecure,
426-
resizeHide = _props.resizeHide;
424+
var _props = this.props;
425+
var insecure = _props.insecure;
426+
var resizeHide = _props.resizeHide;
427427

428428
if (insecure) {
429429
this.setStyleHeader(); // Set the style to the <link>
@@ -491,9 +491,9 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
491491
value: function bindListener() {
492492
var _this3 = this;
493493

494-
var _props2 = this.props,
495-
id = _props2.id,
496-
globalEventOff = _props2.globalEventOff;
494+
var _props2 = this.props;
495+
var id = _props2.id;
496+
var globalEventOff = _props2.globalEventOff;
497497

498498
var targetArray = this.getTargetArray(id);
499499

@@ -532,9 +532,9 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
532532
value: function unbindListener() {
533533
var _this4 = this;
534534

535-
var _props3 = this.props,
536-
id = _props3.id,
537-
globalEventOff = _props3.globalEventOff;
535+
var _props3 = this.props;
536+
var id = _props3.id;
537+
var globalEventOff = _props3.globalEventOff;
538538

539539
var targetArray = this.getTargetArray(id);
540540
targetArray.forEach(function (target) {
@@ -554,9 +554,10 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
554554
}, {
555555
key: 'unbindBasicListener',
556556
value: function unbindBasicListener(target) {
557-
target.removeEventListener('mouseenter', this.showTooltip);
558-
target.removeEventListener('mousemove', this.updateTooltip);
559-
target.removeEventListener('mouseleave', this.hideTooltip);
557+
var isCaptureMode = this.isCapture(target);
558+
target.removeEventListener('mouseenter', this.showTooltip, isCaptureMode);
559+
target.removeEventListener('mousemove', this.updateTooltip, isCaptureMode);
560+
target.removeEventListener('mouseleave', this.hideTooltip, isCaptureMode);
560561
}
561562

562563
/**
@@ -578,10 +579,10 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
578579
}
579580
// Get the tooltip content
580581
// calculate in this phrase so that tip width height can be detected
581-
var _props4 = this.props,
582-
children = _props4.children,
583-
multiline = _props4.multiline,
584-
getContent = _props4.getContent;
582+
var _props4 = this.props;
583+
var children = _props4.children;
584+
var multiline = _props4.multiline;
585+
var getContent = _props4.getContent;
585586

586587
var originTooltip = e.currentTarget.getAttribute('data-tip');
587588
var isMultiline = e.currentTarget.getAttribute('data-multiline') || multiline || false;
@@ -652,11 +653,11 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
652653
value: function updateTooltip(e) {
653654
var _this6 = this;
654655

655-
var _state = this.state,
656-
delayShow = _state.delayShow,
657-
show = _state.show,
658-
isEmptyTip = _state.isEmptyTip,
659-
disable = _state.disable;
656+
var _state = this.state;
657+
var delayShow = _state.delayShow;
658+
var show = _state.show;
659+
var isEmptyTip = _state.isEmptyTip;
660+
var disable = _state.disable;
660661
var afterShow = this.props.afterShow;
661662
var placeholder = this.state.placeholder;
662663

@@ -697,10 +698,10 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
697698
value: function hideTooltip(e, hasTarget) {
698699
var _this7 = this;
699700

700-
var _state2 = this.state,
701-
delayHide = _state2.delayHide,
702-
isEmptyTip = _state2.isEmptyTip,
703-
disable = _state2.disable;
701+
var _state2 = this.state;
702+
var delayHide = _state2.delayHide;
703+
var isEmptyTip = _state2.isEmptyTip;
704+
var disable = _state2.disable;
704705
var afterHide = this.props.afterHide;
705706

706707
if (!this.mount) return;
@@ -755,12 +756,12 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
755756
value: function updatePosition() {
756757
var _this8 = this;
757758

758-
var _state3 = this.state,
759-
currentEvent = _state3.currentEvent,
760-
currentTarget = _state3.currentTarget,
761-
place = _state3.place,
762-
effect = _state3.effect,
763-
offset = _state3.offset;
759+
var _state3 = this.state;
760+
var currentEvent = _state3.currentEvent;
761+
var currentTarget = _state3.currentTarget;
762+
var place = _state3.place;
763+
var effect = _state3.effect;
764+
var offset = _state3.offset;
764765

765766
var node = _reactDom2.default.findDOMNode(this);
766767
var result = (0, _getPosition2.default)(currentEvent, currentTarget, node, place, effect, offset);
@@ -806,13 +807,13 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
806807
}, {
807808
key: 'render',
808809
value: function render() {
809-
var _state4 = this.state,
810-
placeholder = _state4.placeholder,
811-
extraClass = _state4.extraClass,
812-
html = _state4.html,
813-
ariaProps = _state4.ariaProps,
814-
disable = _state4.disable,
815-
isEmptyTip = _state4.isEmptyTip;
810+
var _state4 = this.state;
811+
var placeholder = _state4.placeholder;
812+
var extraClass = _state4.extraClass;
813+
var html = _state4.html;
814+
var ariaProps = _state4.ariaProps;
815+
var disable = _state4.disable;
816+
var isEmptyTip = _state4.isEmptyTip;
816817

817818
var tooltipClass = (0, _classnames2.default)('__react_component_tooltip', { 'show': this.state.show && !disable && !isEmptyTip }, { 'border': this.state.border }, { 'place-top': this.state.place === 'top' }, { 'place-bottom': this.state.place === 'bottom' }, { 'place-left': this.state.place === 'left' }, { 'place-right': this.state.place === 'right' }, { 'type-dark': this.state.type === 'dark' }, { 'type-success': this.state.type === 'success' }, { 'type-warning': this.state.type === 'warning' }, { 'type-error': this.state.type === 'error' }, { 'type-info': this.state.type === 'info' }, { 'type-light': this.state.type === 'light' });
818819
if (html) {
@@ -914,25 +915,28 @@ exports.default = function (e, target, node, place, effect, offset) {
914915
var tipWidth = node.clientWidth;
915916
var tipHeight = node.clientHeight;
916917

917-
var _getCurrentOffset = getCurrentOffset(e, target, effect),
918-
mouseX = _getCurrentOffset.mouseX,
919-
mouseY = _getCurrentOffset.mouseY;
918+
var _getCurrentOffset = getCurrentOffset(e, target, effect);
919+
920+
var mouseX = _getCurrentOffset.mouseX;
921+
var mouseY = _getCurrentOffset.mouseY;
920922

921923
var defaultOffset = getDefaultPosition(effect, target.clientWidth, target.clientHeight, tipWidth, tipHeight);
922924

923-
var _calculateOffset = calculateOffset(offset),
924-
extraOffset_X = _calculateOffset.extraOffset_X,
925-
extraOffset_Y = _calculateOffset.extraOffset_Y;
925+
var _calculateOffset = calculateOffset(offset);
926+
927+
var extraOffset_X = _calculateOffset.extraOffset_X;
928+
var extraOffset_Y = _calculateOffset.extraOffset_Y;
929+
926930

927931
var windowWidth = window.innerWidth;
928932
var windowHeight = window.innerHeight;
929933

930-
var _getParent = getParent(node),
931-
parentTop = _getParent.parentTop,
932-
parentLeft = _getParent.parentLeft;
934+
var _getParent = getParent(node);
933935

934-
// Get the edge offset of the tooltip
936+
var parentTop = _getParent.parentTop;
937+
var parentLeft = _getParent.parentLeft;
935938

939+
// Get the edge offset of the tooltip
936940

937941
var getTipOffsetLeft = function getTipOffsetLeft(place) {
938942
var offset_X = defaultOffset[place].l;
@@ -965,10 +969,10 @@ exports.default = function (e, target, node, place, effect, offset) {
965969
return { result: result, newPlace: newPlace };
966970
};
967971
var outsideLeft = function outsideLeft() {
968-
var _outsideVertical = outsideVertical(),
969-
result = _outsideVertical.result,
970-
newPlace = _outsideVertical.newPlace; // Deal with vertical as first priority
972+
var _outsideVertical = outsideVertical();
971973

974+
var result = _outsideVertical.result;
975+
var newPlace = _outsideVertical.newPlace; // Deal with vertical as first priority
972976

973977
if (result && outsideHorizontal().result) {
974978
return { result: false }; // No need to change, if change to vertical will out of space
@@ -980,9 +984,10 @@ exports.default = function (e, target, node, place, effect, offset) {
980984
return { result: result, newPlace: newPlace };
981985
};
982986
var outsideRight = function outsideRight() {
983-
var _outsideVertical2 = outsideVertical(),
984-
result = _outsideVertical2.result,
985-
newPlace = _outsideVertical2.newPlace;
987+
var _outsideVertical2 = outsideVertical();
988+
989+
var result = _outsideVertical2.result;
990+
var newPlace = _outsideVertical2.newPlace;
986991

987992
if (result && outsideHorizontal().result) {
988993
return { result: false }; // No need to change, if change to vertical will out of space
@@ -1007,9 +1012,10 @@ exports.default = function (e, target, node, place, effect, offset) {
10071012
return { result: result, newPlace: newPlace };
10081013
};
10091014
var outsideTop = function outsideTop() {
1010-
var _outsideHorizontal = outsideHorizontal(),
1011-
result = _outsideHorizontal.result,
1012-
newPlace = _outsideHorizontal.newPlace;
1015+
var _outsideHorizontal = outsideHorizontal();
1016+
1017+
var result = _outsideHorizontal.result;
1018+
var newPlace = _outsideHorizontal.newPlace;
10131019

10141020
if (result && outsideVertical().result) {
10151021
return { result: false };
@@ -1021,9 +1027,10 @@ exports.default = function (e, target, node, place, effect, offset) {
10211027
return { result: result, newPlace: newPlace };
10221028
};
10231029
var outsideBottom = function outsideBottom() {
1024-
var _outsideHorizontal2 = outsideHorizontal(),
1025-
result = _outsideHorizontal2.result,
1026-
newPlace = _outsideHorizontal2.newPlace;
1030+
var _outsideHorizontal2 = outsideHorizontal();
1031+
1032+
var result = _outsideHorizontal2.result;
1033+
var newPlace = _outsideHorizontal2.newPlace;
10271034

10281035
if (result && outsideVertical().result) {
10291036
return { result: false };

standalone/react-tooltip.min.js

+2-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)