react-joyride
Advanced tools
Comparing version 1.1.0 to 1.1.1
var React = require('react'), | ||
hexToRGB = require('./utils.js').hexToRgb; | ||
var isTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints; | ||
var Beacon = React.createClass({ | ||
@@ -73,4 +75,4 @@ displayName: 'JoyrideBeacon', | ||
style: styles.beacon, | ||
onClick: props.eventType === 'click' ? props.onTrigger : null, | ||
onMouseEnter: props.eventType === 'hover' ? props.onTrigger : null | ||
onClick: props.eventType === 'click' || isTouch ? props.onTrigger : null, | ||
onMouseEnter: props.eventType === 'hover' && !isTouch ? props.onTrigger : null | ||
}, | ||
@@ -77,0 +79,0 @@ React.createElement('span', { |
@@ -18,3 +18,4 @@ var React = require('react'), | ||
tooltips: {} | ||
}; | ||
}, | ||
isTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints; | ||
@@ -268,8 +269,10 @@ var Component = React.createClass({ | ||
if (eventType === 'hover') { | ||
if (eventType === 'hover' && !isTouch) { | ||
listeners.tooltips[key] = { event: 'mouseenter', cb: this._onTooltipTrigger }; | ||
listeners.tooltips[key + 'mouseleave'] = { event: 'mouseleave', cb: this._onTooltipTrigger }; | ||
listeners.tooltips[key + 'click'] = { event: 'click', cb: function (e) { | ||
e.preventDefault(); | ||
} }; | ||
listeners.tooltips[key + 'click'] = { | ||
event: 'click', cb: function (e) { | ||
e.preventDefault(); | ||
} | ||
}; | ||
@@ -281,4 +284,4 @@ el.addEventListener('mouseenter', listeners.tooltips[key].cb); | ||
else { | ||
listeners.tooltips[key] = { event: eventType, cb: this._onTooltipTrigger }; | ||
el.addEventListener(eventType, listeners.tooltips[key].cb); | ||
listeners.tooltips[key] = { event: 'click', cb: this._onTooltipTrigger }; | ||
el.addEventListener('click', listeners.tooltips[key].cb); | ||
} | ||
@@ -285,0 +288,0 @@ }, |
{ | ||
"name": "react-joyride", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"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
67177
1209