react-hammerjs
Advanced tools
Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "react-hammerjs", | ||
"main": "dist/react-hammerjs.min.js", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"homepage": "https://github.com/JedWatson/react-hammerjs", | ||
@@ -6,0 +6,0 @@ "authors": [ |
@@ -58,4 +58,6 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Hammer = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
componentWillUnmount: function() { | ||
this.hammer.stop(); | ||
this.hammer.destroy(); | ||
if (this.hammer) { | ||
this.hammer.stop(); | ||
this.hammer.destroy(); | ||
} | ||
this.hammer = null; | ||
@@ -62,0 +64,0 @@ }, |
@@ -1,1 +0,1 @@ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o;o="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,o.Hammer=e()}}(function(){return function e(o,n,t){function i(s,p){if(!n[s]){if(!o[s]){var a="function"==typeof require&&require;if(!p&&a)return a(s,!0);if(r)return r(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var f=n[s]={exports:{}};o[s][0].call(f.exports,function(e){var n=o[s][1][e];return i(n?n:e)},f,f.exports,e,o,n,t)}return n[s].exports}for(var r="function"==typeof require&&require,s=0;s<t.length;s++)i(t[s]);return i}({1:[function(e,o){(function(n){var t="undefined"!=typeof window?window.React:"undefined"!=typeof n?n.React:null,i=e("hammerjs"),r={component:!0,children:!0,action:!0,onTap:!0,onDoubleTap:!0,onPan:!0,onSwipe:!0,onPress:!0,onPinch:!0,onRotate:!0},s=t.createClass({displayName:"Hammer",propTypes:{component:t.PropTypes.any,className:t.PropTypes.string},getDefaultProps:function(){return{component:"span"}},componentDidMount:function(){this.hammer=new i(this.getDOMNode()),this.props.vertical&&(this.hammer.get("pan").set({direction:i.DIRECTION_ALL}),this.hammer.get("swipe").set({direction:i.DIRECTION_ALL})),this.props.action&&this.hammer.on("tap press",this.props.action),this.props.onTap&&this.hammer.on("tap",this.props.onTap),this.props.onDoubleTap&&this.hammer.on("doubletap",this.props.onDoubleTap),this.props.onPan&&this.hammer.on("pan",this.props.onPan),this.props.onSwipe&&this.hammer.on("swipe",this.props.onSwipe),this.props.onPress&&this.hammer.on("press",this.props.onPress),this.props.onPinch&&this.hammer.on("pinch",this.props.onPinch),this.props.onRotate&&this.hammer.on("rotate",this.props.onRotate)},componentWillUnmount:function(){this.hammer.stop(),this.hammer.destroy(),this.hammer=null},render:function(){var e={};return Object.keys(this.props).forEach(function(o){r[o]||(e[o]=this.props[o])},this),t.createElement(this.props.component,e,this.props.children)}});o.exports=s}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{hammerjs:void 0}]},{},[1])(1)}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o;o="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,o.Hammer=e()}}(function(){return function e(o,n,t){function i(s,p){if(!n[s]){if(!o[s]){var a="function"==typeof require&&require;if(!p&&a)return a(s,!0);if(r)return r(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var f=n[s]={exports:{}};o[s][0].call(f.exports,function(e){var n=o[s][1][e];return i(n?n:e)},f,f.exports,e,o,n,t)}return n[s].exports}for(var r="function"==typeof require&&require,s=0;s<t.length;s++)i(t[s]);return i}({1:[function(e,o){(function(n){var t="undefined"!=typeof window?window.React:"undefined"!=typeof n?n.React:null,i=e("hammerjs"),r={component:!0,children:!0,action:!0,onTap:!0,onDoubleTap:!0,onPan:!0,onSwipe:!0,onPress:!0,onPinch:!0,onRotate:!0},s=t.createClass({displayName:"Hammer",propTypes:{component:t.PropTypes.any,className:t.PropTypes.string},getDefaultProps:function(){return{component:"span"}},componentDidMount:function(){this.hammer=new i(this.getDOMNode()),this.props.vertical&&(this.hammer.get("pan").set({direction:i.DIRECTION_ALL}),this.hammer.get("swipe").set({direction:i.DIRECTION_ALL})),this.props.action&&this.hammer.on("tap press",this.props.action),this.props.onTap&&this.hammer.on("tap",this.props.onTap),this.props.onDoubleTap&&this.hammer.on("doubletap",this.props.onDoubleTap),this.props.onPan&&this.hammer.on("pan",this.props.onPan),this.props.onSwipe&&this.hammer.on("swipe",this.props.onSwipe),this.props.onPress&&this.hammer.on("press",this.props.onPress),this.props.onPinch&&this.hammer.on("pinch",this.props.onPinch),this.props.onRotate&&this.hammer.on("rotate",this.props.onRotate)},componentWillUnmount:function(){this.hammer&&(this.hammer.stop(),this.hammer.destroy()),this.hammer=null},render:function(){var e={};return Object.keys(this.props).forEach(function(o){r[o]||(e[o]=this.props[o])},this),t.createElement(this.props.component,e,this.props.children)}});o.exports=s}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{hammerjs:void 0}]},{},[1])(1)}); |
{ | ||
"name": "react-hammerjs", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "ReactJS / HammerJS integration. Support touch events in your React app.", | ||
@@ -5,0 +5,0 @@ "main": "src/Hammer.js", |
@@ -56,4 +56,6 @@ var React = require('react'), | ||
componentWillUnmount: function() { | ||
this.hammer.stop(); | ||
this.hammer.destroy(); | ||
if (this.hammer) { | ||
this.hammer.stop(); | ||
this.hammer.destroy(); | ||
} | ||
this.hammer = null; | ||
@@ -60,0 +62,0 @@ }, |
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
14160
260