rc-hammerjs
Advanced tools
Comparing version 0.6.7 to 0.6.8
@@ -11,4 +11,5 @@ import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; | ||
// https://github.com/JedWatson/react-hammerjs/issues/14 | ||
// wait to see if we need the condition require hack for ssr | ||
import Hammer from 'hammerjs'; | ||
// require('hammerjs') when in a browser. This is safe because Hammer is only | ||
// invoked in componentDidMount, which is not executed on the server. | ||
var Hammer = typeof window !== 'undefined' ? require('hammerjs') : undefined; | ||
@@ -15,0 +16,0 @@ var privateProps = { |
@@ -35,8 +35,10 @@ 'use strict'; | ||
var _hammerjs = require('hammerjs'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _hammerjs2 = _interopRequireDefault(_hammerjs); | ||
// https://github.com/hammerjs/hammer.js/issues/930 | ||
// https://github.com/JedWatson/react-hammerjs/issues/14 | ||
// require('hammerjs') when in a browser. This is safe because Hammer is only | ||
// invoked in componentDidMount, which is not executed on the server. | ||
var Hammer = typeof window !== 'undefined' ? require('hammerjs') : undefined; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var privateProps = { | ||
@@ -55,5 +57,2 @@ children: true, | ||
// https://github.com/hammerjs/hammer.js/issues/930 | ||
// https://github.com/JedWatson/react-hammerjs/issues/14 | ||
// wait to see if we need the condition require hack for ssr | ||
var handlerToEvent = { | ||
@@ -101,4 +100,4 @@ action: 'tap press', | ||
var direction = directionProp ? directionProp : props.vertical ? 'DIRECTION_ALL' : 'DIRECTION_HORIZONTAL'; | ||
hammer.get('pan').set({ direction: _hammerjs2['default'][direction] }); | ||
hammer.get('swipe').set({ direction: _hammerjs2['default'][direction] }); | ||
hammer.get('pan').set({ direction: Hammer[direction] }); | ||
hammer.get('swipe').set({ direction: Hammer[direction] }); | ||
} | ||
@@ -152,3 +151,3 @@ | ||
value: function componentDidMount() { | ||
this.hammer = new _hammerjs2['default'](_reactDom2['default'].findDOMNode(this)); | ||
this.hammer = new Hammer(_reactDom2['default'].findDOMNode(this)); | ||
updateHammer(this.hammer, this.props); | ||
@@ -155,0 +154,0 @@ } |
{ | ||
"name": "rc-hammerjs", | ||
"version": "0.6.7", | ||
"version": "0.6.8", | ||
"description": "ReactJS / HammerJS integration. Support touch events in your React app.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index", |
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
15483
310