Skip to content

Commit c4a4f87

Browse files
committed
3.2.6
1 parent 375989f commit c4a4f87

File tree

4 files changed

+79
-71
lines changed

4 files changed

+79
-71
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
## Change Log
22

3-
### 3.2.4 (2017/02/07 03:53 +00:00)
3+
### 3.2.6 (2017/02/08 12:33 +00:00)
4+
- [#255](https://github.com/wwayne/react-tooltip/pull/255) (fix) Remove console logs (@flexpert)
5+
- [#254](https://github.com/wwayne/react-tooltip/pull/254) Add support for className prop (@jonbeller)
6+
7+
### 3.2.4 (2017/02/07 03:57 +00:00)
48
- [#251](https://github.com/wwayne/react-tooltip/pull/251) Dropfen dynamic wrapper (@dropfen)
59

610
### 3.2.3 (2017/01/30 03:00 +00:00)

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": "3.2.5",
3+
"version": "3.2.6",
44
"description": "react tooltip component",
55
"main": "dist/index.js",
66
"scripts": {

standalone/react-tooltip.js

Lines changed: 71 additions & 66 deletions
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');
@@ -176,9 +176,7 @@ Object.defineProperty(exports, "__esModule", {
176176

177177
exports.default = function (target) {
178178
target.prototype.isCapture = function (currentTarget) {
179-
console.log('currentTarget', currentTarget);
180179
var dataIsCapture = currentTarget.getAttribute('data-iscapture');
181-
console.log(currentTarget.getAttribute('data-iscapture'), dataIsCapture);
182180
return dataIsCapture && dataIsCapture === 'true' || this.props.isCapture || false;
183181
};
184182
};
@@ -441,9 +439,9 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
441439
}, {
442440
key: 'componentDidMount',
443441
value: function componentDidMount() {
444-
var _props = this.props,
445-
insecure = _props.insecure,
446-
resizeHide = _props.resizeHide;
442+
var _props = this.props;
443+
var insecure = _props.insecure;
444+
var resizeHide = _props.resizeHide;
447445

448446
if (insecure) {
449447
this.setStyleHeader(); // Set the style to the <link>
@@ -509,9 +507,9 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
509507
value: function bindListener() {
510508
var _this3 = this;
511509

512-
var _props2 = this.props,
513-
id = _props2.id,
514-
globalEventOff = _props2.globalEventOff;
510+
var _props2 = this.props;
511+
var id = _props2.id;
512+
var globalEventOff = _props2.globalEventOff;
515513

516514
var targetArray = this.getTargetArray(id);
517515

@@ -551,9 +549,9 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
551549
value: function unbindListener() {
552550
var _this4 = this;
553551

554-
var _props3 = this.props,
555-
id = _props3.id,
556-
globalEventOff = _props3.globalEventOff;
552+
var _props3 = this.props;
553+
var id = _props3.id;
554+
var globalEventOff = _props3.globalEventOff;
557555

558556
var targetArray = this.getTargetArray(id);
559557
targetArray.forEach(function (target) {
@@ -598,10 +596,10 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
598596
}
599597
// Get the tooltip content
600598
// calculate in this phrase so that tip width height can be detected
601-
var _props4 = this.props,
602-
children = _props4.children,
603-
multiline = _props4.multiline,
604-
getContent = _props4.getContent;
599+
var _props4 = this.props;
600+
var children = _props4.children;
601+
var multiline = _props4.multiline;
602+
var getContent = _props4.getContent;
605603

606604
var originTooltip = e.currentTarget.getAttribute('data-tip');
607605
var isMultiline = e.currentTarget.getAttribute('data-multiline') || multiline || false;
@@ -643,7 +641,7 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
643641
delayShow: e.currentTarget.getAttribute('data-delay-show') || this.props.delayShow || 0,
644642
delayHide: e.currentTarget.getAttribute('data-delay-hide') || this.props.delayHide || 0,
645643
border: e.currentTarget.getAttribute('data-border') ? e.currentTarget.getAttribute('data-border') === 'true' : this.props.border || false,
646-
extraClass: e.currentTarget.getAttribute('data-class') || this.props.class || '',
644+
extraClass: e.currentTarget.getAttribute('data-class') || this.props.class || this.props.className || '',
647645
disable: e.currentTarget.getAttribute('data-tip-disable') ? e.currentTarget.getAttribute('data-tip-disable') === 'true' : this.props.disable || false
648646
}, function () {
649647
if (scrollHide) _this5.addScrollListener(e);
@@ -675,11 +673,11 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
675673
value: function updateTooltip(e) {
676674
var _this6 = this;
677675

678-
var _state = this.state,
679-
delayShow = _state.delayShow,
680-
show = _state.show,
681-
isEmptyTip = _state.isEmptyTip,
682-
disable = _state.disable;
676+
var _state = this.state;
677+
var delayShow = _state.delayShow;
678+
var show = _state.show;
679+
var isEmptyTip = _state.isEmptyTip;
680+
var disable = _state.disable;
683681
var afterShow = this.props.afterShow;
684682
var placeholder = this.state.placeholder;
685683

@@ -720,10 +718,10 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
720718
value: function hideTooltip(e, hasTarget) {
721719
var _this7 = this;
722720

723-
var _state2 = this.state,
724-
delayHide = _state2.delayHide,
725-
isEmptyTip = _state2.isEmptyTip,
726-
disable = _state2.disable;
721+
var _state2 = this.state;
722+
var delayHide = _state2.delayHide;
723+
var isEmptyTip = _state2.isEmptyTip;
724+
var disable = _state2.disable;
727725
var afterHide = this.props.afterHide;
728726

729727
if (!this.mount) return;
@@ -778,12 +776,12 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
778776
value: function updatePosition() {
779777
var _this8 = this;
780778

781-
var _state3 = this.state,
782-
currentEvent = _state3.currentEvent,
783-
currentTarget = _state3.currentTarget,
784-
place = _state3.place,
785-
effect = _state3.effect,
786-
offset = _state3.offset;
779+
var _state3 = this.state;
780+
var currentEvent = _state3.currentEvent;
781+
var currentTarget = _state3.currentTarget;
782+
var place = _state3.place;
783+
var effect = _state3.effect;
784+
var offset = _state3.offset;
787785

788786
var node = _reactDom2.default.findDOMNode(this);
789787
var result = (0, _getPosition2.default)(currentEvent, currentTarget, node, place, effect, offset);
@@ -829,13 +827,13 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
829827
}, {
830828
key: 'render',
831829
value: function render() {
832-
var _state4 = this.state,
833-
placeholder = _state4.placeholder,
834-
extraClass = _state4.extraClass,
835-
html = _state4.html,
836-
ariaProps = _state4.ariaProps,
837-
disable = _state4.disable,
838-
isEmptyTip = _state4.isEmptyTip;
830+
var _state4 = this.state;
831+
var placeholder = _state4.placeholder;
832+
var extraClass = _state4.extraClass;
833+
var html = _state4.html;
834+
var ariaProps = _state4.ariaProps;
835+
var disable = _state4.disable;
836+
var isEmptyTip = _state4.isEmptyTip;
839837

840838
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' });
841839

@@ -870,6 +868,7 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de
870868
border: _react.PropTypes.bool,
871869
insecure: _react.PropTypes.bool,
872870
class: _react.PropTypes.string,
871+
className: _react.PropTypes.string,
873872
id: _react.PropTypes.string,
874873
html: _react.PropTypes.bool,
875874
delayHide: _react.PropTypes.number,
@@ -946,25 +945,28 @@ exports.default = function (e, target, node, place, effect, offset) {
946945
var tipWidth = node.clientWidth;
947946
var tipHeight = node.clientHeight;
948947

949-
var _getCurrentOffset = getCurrentOffset(e, target, effect),
950-
mouseX = _getCurrentOffset.mouseX,
951-
mouseY = _getCurrentOffset.mouseY;
948+
var _getCurrentOffset = getCurrentOffset(e, target, effect);
949+
950+
var mouseX = _getCurrentOffset.mouseX;
951+
var mouseY = _getCurrentOffset.mouseY;
952952

953953
var defaultOffset = getDefaultPosition(effect, target.clientWidth, target.clientHeight, tipWidth, tipHeight);
954954

955-
var _calculateOffset = calculateOffset(offset),
956-
extraOffset_X = _calculateOffset.extraOffset_X,
957-
extraOffset_Y = _calculateOffset.extraOffset_Y;
955+
var _calculateOffset = calculateOffset(offset);
956+
957+
var extraOffset_X = _calculateOffset.extraOffset_X;
958+
var extraOffset_Y = _calculateOffset.extraOffset_Y;
959+
958960

959961
var windowWidth = window.innerWidth;
960962
var windowHeight = window.innerHeight;
961963

962-
var _getParent = getParent(node),
963-
parentTop = _getParent.parentTop,
964-
parentLeft = _getParent.parentLeft;
964+
var _getParent = getParent(node);
965965

966-
// Get the edge offset of the tooltip
966+
var parentTop = _getParent.parentTop;
967+
var parentLeft = _getParent.parentLeft;
967968

969+
// Get the edge offset of the tooltip
968970

969971
var getTipOffsetLeft = function getTipOffsetLeft(place) {
970972
var offset_X = defaultOffset[place].l;
@@ -997,10 +999,10 @@ exports.default = function (e, target, node, place, effect, offset) {
997999
return { result: result, newPlace: newPlace };
9981000
};
9991001
var outsideLeft = function outsideLeft() {
1000-
var _outsideVertical = outsideVertical(),
1001-
result = _outsideVertical.result,
1002-
newPlace = _outsideVertical.newPlace; // Deal with vertical as first priority
1002+
var _outsideVertical = outsideVertical();
10031003

1004+
var result = _outsideVertical.result;
1005+
var newPlace = _outsideVertical.newPlace; // Deal with vertical as first priority
10041006

10051007
if (result && outsideHorizontal().result) {
10061008
return { result: false }; // No need to change, if change to vertical will out of space
@@ -1012,9 +1014,10 @@ exports.default = function (e, target, node, place, effect, offset) {
10121014
return { result: result, newPlace: newPlace };
10131015
};
10141016
var outsideRight = function outsideRight() {
1015-
var _outsideVertical2 = outsideVertical(),
1016-
result = _outsideVertical2.result,
1017-
newPlace = _outsideVertical2.newPlace;
1017+
var _outsideVertical2 = outsideVertical();
1018+
1019+
var result = _outsideVertical2.result;
1020+
var newPlace = _outsideVertical2.newPlace;
10181021

10191022
if (result && outsideHorizontal().result) {
10201023
return { result: false }; // No need to change, if change to vertical will out of space
@@ -1039,9 +1042,10 @@ exports.default = function (e, target, node, place, effect, offset) {
10391042
return { result: result, newPlace: newPlace };
10401043
};
10411044
var outsideTop = function outsideTop() {
1042-
var _outsideHorizontal = outsideHorizontal(),
1043-
result = _outsideHorizontal.result,
1044-
newPlace = _outsideHorizontal.newPlace;
1045+
var _outsideHorizontal = outsideHorizontal();
1046+
1047+
var result = _outsideHorizontal.result;
1048+
var newPlace = _outsideHorizontal.newPlace;
10451049

10461050
if (result && outsideVertical().result) {
10471051
return { result: false };
@@ -1053,9 +1057,10 @@ exports.default = function (e, target, node, place, effect, offset) {
10531057
return { result: result, newPlace: newPlace };
10541058
};
10551059
var outsideBottom = function outsideBottom() {
1056-
var _outsideHorizontal2 = outsideHorizontal(),
1057-
result = _outsideHorizontal2.result,
1058-
newPlace = _outsideHorizontal2.newPlace;
1060+
var _outsideHorizontal2 = outsideHorizontal();
1061+
1062+
var result = _outsideHorizontal2.result;
1063+
var newPlace = _outsideHorizontal2.newPlace;
10591064

10601065
if (result && outsideVertical().result) {
10611066
return { result: false };

standalone/react-tooltip.min.js

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)