react-joyride
Advanced tools
Comparing version 0.7.1 to 0.7.2
@@ -8,2 +8,9 @@ var React = require('react/addons'), | ||
browser: undefined, | ||
defaultState: { | ||
_joyrideCurrentIndex: 0, | ||
_joyridePlay: false, | ||
_joyrideShowTooltip: false, | ||
_joyrideXPos: -1000, | ||
_joyrideYPos: -1000 | ||
}, | ||
initialized: false, | ||
@@ -274,4 +281,4 @@ listeners: {}, | ||
* Toggle Tooltip's visibility | ||
* @param {Boolean} show Render the tooltip directly or the beacon | ||
* @param {Number} index The tour's new index | ||
* @param {Boolean} show - Render the tooltip directly or the beacon | ||
* @param {Number} index - The tour's new index | ||
*/ | ||
@@ -330,9 +337,3 @@ toggleTooltip: function (show, index) { | ||
getInitialState: function () { | ||
return { | ||
_joyrideCurrentIndex: 0, | ||
_joyridePlay: false, | ||
_joyrideShowTooltip: false, | ||
_joyrideXPos: -1000, | ||
_joyrideYPos: -1000 | ||
}; | ||
return joyride.defaultState; | ||
}, | ||
@@ -374,3 +375,3 @@ | ||
opt = { | ||
shouldRun: state._joyridePlay && (state._joyridePlay !== prevState._joyridePlay || state._joyrideCurrentIndex !== prevState._joyrideCurrentIndex), | ||
shouldRun: (state._joyridePlay !== prevState._joyridePlay || state._joyrideCurrentIndex !== prevState._joyrideCurrentIndex), | ||
hasStep: Boolean(joyride.steps[state._joyrideCurrentIndex]), | ||
@@ -383,3 +384,3 @@ hasSteps: joyride.steps.length > 0, | ||
if ((opt.shouldRun || opt.toggleTooltip || opt.newX || opt.newY) && opt.hasStep) { | ||
if (state._joyridePlay && (opt.shouldRun || opt.toggleTooltip || opt.newX || opt.newY) && opt.hasStep) { | ||
this._joyrideRenderLayer(); | ||
@@ -414,3 +415,2 @@ } | ||
joyrideAddSteps: function (steps, start) { | ||
start = start || this.state._joyridePlay; | ||
@@ -432,7 +432,7 @@ | ||
steps = steps || []; | ||
restart = restart || true; | ||
restart = restart !== false; | ||
joyride.steps = joyride.parseSteps(steps); | ||
joyride.skipped = false; | ||
this._target.innerHTML = ''; | ||
React.unmountComponentAtNode(this._target); | ||
@@ -444,6 +444,3 @@ // Force a new render if necessary | ||
this.setState({ | ||
_joyrideCurrentIndex: 0, | ||
_joyridePlay: restart | ||
}); | ||
this.setState(joyride.defaultState); | ||
}, | ||
@@ -476,3 +473,5 @@ | ||
_joyrideRenderLayer: function () { | ||
var component = this._joyrideRenderStep(); | ||
var state = this.state, | ||
component = this._joyrideRenderStep(); | ||
if (!joyride.initialized) { | ||
@@ -485,6 +484,6 @@ joyride.initialized = true; | ||
joyride.calcPlacement(); | ||
if (joyride.steps[this.state._joyrideCurrentIndex] && joyride.options.scrollToSteps) { | ||
if (joyride.steps[state._joyrideCurrentIndex] && joyride.options.scrollToSteps) { | ||
scroll.top(document.body, joyride.getScrollTop()); | ||
} | ||
}.bind(this)); | ||
}); | ||
}, | ||
@@ -491,0 +490,0 @@ |
{ | ||
"name": "react-joyride", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"description": "Create walkthroughs and guided tours for your apps", | ||
@@ -5,0 +5,0 @@ "author": "Gil Barbara <gilbarbara@gmail.com>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52831
898