Skip to content

Commit

Permalink
fix toggleTooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbarbara committed Nov 25, 2015
1 parent 633b0c9 commit e8bce26
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions lib/scripts/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,25 +449,24 @@ var Component = React.createClass({
* @param {Number} index - The tour's new index
*/
_toggleTooltip: function (show, index) {
var state = this.state,
props = this.props;
index = (index !== undefined ? index : this.state.index);

index = (index !== undefined ? index : state.index);
var props = this.props;

this.setState({
play: props.steps[index] ? state.play : false,
play: props.steps[index] ? this.state.play : false,
showTooltip: show,
index: index,
xPos: -1000,
yPos: -1000
}, function () {
if (typeof props.stepCallback === 'function' && props.steps[state.index]) {
props.stepCallback(props.steps[state.index]);
if (typeof props.stepCallback === 'function' && props.steps[this.state.index]) {
props.stepCallback(props.steps[this.state.index]);
}

if (props.steps.length && !props.steps[state.index]) {
if (props.steps.length && !props.steps[this.state.index]) {
if (typeof props.completeCallback === 'function') {
props.completeCallback(props.steps, state.skipped);
props.completeCallback(props.steps, this.state.skipped);
}
}
});
Expand Down

0 comments on commit e8bce26

Please sign in to comment.