react-joyride
Advanced tools
Comparing version 0.7.5 to 0.7.6
@@ -61,3 +61,3 @@ var React = require('react/addons'), | ||
var isChrome = Boolean(window.chrome) && !isOpera;// Chrome 1+ | ||
var isIE = /*@cc_on!@*/false || Boolean(document.documentMode); // At least IE6 | ||
var isIE = /*@cc_on!@*/ Boolean(document.documentMode); // At least IE6 | ||
@@ -158,3 +158,4 @@ return (this.browser = | ||
var state = this.state, | ||
type = e.currentTarget.getAttribute('data-type'), | ||
el = e.target, | ||
type = el.dataset.type, | ||
newIndex = state._joyrideCurrentIndex + (type === 'back' ? -1 : 1); | ||
@@ -167,7 +168,9 @@ | ||
joyride.toggleTooltip( | ||
joyride.options.type === 'guided' | ||
&& ['close', 'skip'].indexOf(type) === -1 | ||
&& Boolean(joyride.steps[newIndex]) | ||
, newIndex); | ||
if (type) { | ||
joyride.toggleTooltip( | ||
joyride.options.type === 'guided' | ||
&& ['close', 'skip'].indexOf(type) === -1 | ||
&& Boolean(joyride.steps[newIndex]) | ||
, newIndex); | ||
} | ||
}, | ||
@@ -320,4 +323,3 @@ | ||
if (s.selector.dataset && s.selector.dataset.reactid) { | ||
var reactSelector = '[data-reactid="' + s.selector.dataset.reactid + '"]'; | ||
s.selector = reactSelector; | ||
s.selector = '[data-reactid="' + s.selector.dataset.reactid + '"]'; | ||
} | ||
@@ -534,3 +536,3 @@ el = document.querySelector(s.selector); | ||
if (joyride.steps[state._joyrideCurrentIndex] && joyride.options.scrollToSteps) { | ||
scroll.top(document.body, joyride.getScrollTop()); | ||
scroll.top(joyride.browser === 'firefox' ? document.documentElement : document.body, joyride.getScrollTop()); | ||
} | ||
@@ -590,5 +592,3 @@ }); | ||
cssPosition: cssPosition, | ||
overridePosition: joyride.options.overridePosition, | ||
showOverlay: joyride.options.showOverlay, | ||
showSkipButton: joyride.options.showSkipButton, | ||
options: joyride.options, | ||
step: currentStep, | ||
@@ -595,0 +595,0 @@ xPos: state._joyrideXPos, |
@@ -12,7 +12,3 @@ var React = require('react/addons'); | ||
onClick: React.PropTypes.func.isRequired, | ||
overridePosition: React.PropTypes.oneOfType([ | ||
React.PropTypes.string, | ||
React.PropTypes.bool | ||
]).isRequired, | ||
showOverlay: React.PropTypes.bool.isRequired, | ||
options: React.PropTypes.object.isRequired, | ||
step: React.PropTypes.object.isRequired, | ||
@@ -62,3 +58,3 @@ xPos: React.PropTypes.oneOfType([ | ||
target: document.querySelector(props.step.selector).getBoundingClientRect(), | ||
positionClass: props.overridePosition || props.step.position, | ||
positionClass: props.options.overridePosition || props.step.position, | ||
tooltipStyles: { | ||
@@ -87,3 +83,39 @@ position: this.props.cssPosition === 'fixed' ? 'fixed' : 'absolute', | ||
if (props.showOverlay) { | ||
opts.tooltipElement = React.createElement('div', { | ||
className: 'joyride-tooltip ' + opts.positionClass + (props.animate ? ' animate' : ''), | ||
style: opts.tooltipStyles | ||
}, | ||
React.createElement('div', { | ||
className: 'triangle triangle-' + opts.positionClass, | ||
style: opts.arrowPosition | ||
}), | ||
opts.header, | ||
React.createElement('main', { dangerouslySetInnerHTML: { __html: props.step.text || '' } }), | ||
React.createElement('footer', null, | ||
(props.buttons.skip ? | ||
React.createElement('a', { | ||
href: '#', | ||
className: 'skip', | ||
'data-type': 'skip', | ||
onClick: props.onClick | ||
}, props.buttons.skip) | ||
: false), | ||
(props.buttons.secondary ? | ||
React.createElement('a', { | ||
href: '#', | ||
className: 'secondary', | ||
'data-type': 'back', | ||
onClick: props.onClick | ||
}, props.buttons.secondary) | ||
: false), | ||
React.createElement('a', { | ||
href: '#', | ||
className: 'primary', | ||
'data-type': 'next', | ||
onClick: props.onClick | ||
}, props.buttons.primary) | ||
) | ||
); | ||
if (props.options.showOverlay) { | ||
opts.hole = React.createElement('div', { | ||
@@ -106,48 +138,16 @@ className: 'joyride-hole ' + props.browser, | ||
return ( | ||
React.createElement('div', { | ||
className: 'joyride-overlay', | ||
style: { | ||
height: document.body.clientHeight | ||
}, | ||
'data-type': 'close', | ||
onClick: props.onClick | ||
if (!props.options.showOverlay) { | ||
return opts.tooltipElement; | ||
} | ||
return React.createElement('div', { | ||
className: 'joyride-overlay', | ||
style: { | ||
height: document.body.clientHeight | ||
}, | ||
opts.hole, | ||
React.createElement('div', { | ||
className: 'joyride-tooltip ' + opts.positionClass + (props.animate ? ' animate' : ''), | ||
style: opts.tooltipStyles | ||
}, | ||
React.createElement('div', { | ||
className: 'triangle triangle-' + opts.positionClass, | ||
style: opts.arrowPosition | ||
}), | ||
opts.header, | ||
React.createElement('main', { dangerouslySetInnerHTML: { __html: props.step.text || '' } }), | ||
React.createElement('footer', null, | ||
(props.buttons.skip ? | ||
React.createElement('a', { | ||
href: '#', | ||
className: 'skip', | ||
'data-type': 'skip', | ||
onClick: props.onClick | ||
}, props.buttons.skip) | ||
: false), | ||
(props.buttons.secondary ? | ||
React.createElement('a', { | ||
href: '#', | ||
className: 'secondary', | ||
'data-type': 'back', | ||
onClick: props.onClick | ||
}, props.buttons.secondary) | ||
: false), | ||
React.createElement('a', { | ||
href: '#', | ||
className: 'primary', | ||
'data-type': 'next', | ||
onClick: props.onClick | ||
}, props.buttons.primary) | ||
) | ||
) | ||
) | ||
'data-type': 'close', | ||
onClick: props.onClick | ||
}, | ||
opts.hole, | ||
opts.tooltipElement | ||
); | ||
@@ -154,0 +154,0 @@ } |
{ | ||
"name": "react-joyride", | ||
"version": "0.7.5", | ||
"version": "0.7.6", | ||
"description": "Create walkthroughs and guided tours for your apps", | ||
@@ -25,3 +25,3 @@ "author": "Gil Barbara <gilbarbara@gmail.com>", | ||
"dependencies": { | ||
"scroll": "0.0.3" | ||
"scroll": "1.0" | ||
}, | ||
@@ -33,3 +33,3 @@ "peerDependencies": { | ||
"del": "^2.0", | ||
"eslint": "^1.2", | ||
"eslint": "^1.8", | ||
"eslint-plugin-react": "^3.3", | ||
@@ -39,3 +39,3 @@ "gulp": "^3.9", | ||
"gulp-eslint": "^1.0", | ||
"gulp-load-plugins": "^0.10", | ||
"gulp-load-plugins": "^1.0", | ||
"gulp-plumber": "^1.0", | ||
@@ -42,0 +42,0 @@ "gulp-sass": "^2.0", |
@@ -31,3 +31,3 @@ React Joyride | ||
If your are using **SCSS**: | ||
If your are using **SCSS** (and you should): | ||
@@ -244,3 +244,3 @@ ```scss | ||
- `$joyride-tooltip-padding`: Defaults to `20px` | ||
- `$joyride-tooltip-shadow`: Defaults to `drop-shadow(2px 4px 4px rgba(#000, 0.5))` | ||
- `$joyride-tooltip-shadow`: Sass list for drop-shadow. Defaults to `(x: 1px, y: 2px, blur: 3px, color: rgba(#000, 0.3))` | ||
- `$joyride-tooltip-width`: Sass list of Mobile / Tablet / Desktop sizes. Defaults to `(290px, 360px, 450px)` | ||
@@ -247,0 +247,0 @@ - `$joyride-header-color`: Defaults to `$joyride-tooltip-header-color` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
55781
930
+ Addeddom-walk@0.1.2(transitive)
+ Addedglobal@4.3.2(transitive)
+ Addedmin-document@2.19.0(transitive)
+ Addedprocess@0.5.2(transitive)
+ Addedrafl@1.2.2(transitive)
+ Addedscroll@1.0.1(transitive)
- Removedeventlistener@0.0.1(transitive)
- Removedraf-component@1.1.2(transitive)
- Removedscroll@0.0.3(transitive)
Updatedscroll@1.0