Skip to content

Commit

Permalink
Bump 0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kuy committed Jan 10, 2016
1 parent d37767e commit c80eb3a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 16 additions & 2 deletions lib/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,24 @@ var Tooltip = function (_Component) {
var place = nextProps.place;

if (el && (this.props.el != el || this.props.place !== place)) {
var offset = (0, _utils.placement)(place, this.refs.tooltip, el);
this.setState(offset);
this.updatePosition(nextProps);
}
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate(prevProps) {
var content = prevProps.content;

if (this.props.content !== content) {
this.updatePosition(this.props);
}
}
}, {
key: 'updatePosition',
value: function updatePosition(props) {
var offset = (0, _utils.placement)(props.place, this.refs.tooltip, props.el);
this.setState(offset);
}
}, {
key: 'render',
value: function render() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redux-tooltip",
"version": "0.3.0",
"version": "0.3.1",
"description": "A tooltip React component for Redux",
"main": "./lib/index.js",
"repository": {
Expand Down

0 comments on commit c80eb3a

Please sign in to comment.