react-onclickoutside
Advanced tools
Comparing version 6.6.0 to 6.6.1
@@ -117,2 +117,3 @@ (function (global, factory) { | ||
var handlersMap = {}; | ||
var enabledInstances = {}; | ||
@@ -164,3 +165,4 @@ var touchEvents = ['touchstart', 'touchmove']; | ||
}, _this.enableOnClickOutside = function () { | ||
if (typeof document === 'undefined') return; | ||
if (typeof document === 'undefined' || enabledInstances[_this._uid]) return; | ||
enabledInstances[_this._uid] = true; | ||
@@ -206,3 +208,5 @@ var events = _this.props.eventTypes; | ||
}, _this.disableOnClickOutside = function () { | ||
delete enabledInstances[_this._uid]; | ||
var fn = handlersMap[_this._uid]; | ||
if (fn && typeof document !== 'undefined') { | ||
@@ -209,0 +213,0 @@ var events = _this.props.eventTypes; |
@@ -13,2 +13,3 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var handlersMap = {}; | ||
var enabledInstances = {}; | ||
@@ -60,3 +61,4 @@ var touchEvents = ['touchstart', 'touchmove']; | ||
}, _this.enableOnClickOutside = function () { | ||
if (typeof document === 'undefined') return; | ||
if (typeof document === 'undefined' || enabledInstances[_this._uid]) return; | ||
enabledInstances[_this._uid] = true; | ||
@@ -102,3 +104,5 @@ var events = _this.props.eventTypes; | ||
}, _this.disableOnClickOutside = function () { | ||
delete enabledInstances[_this._uid]; | ||
var fn = handlersMap[_this._uid]; | ||
if (fn && typeof document !== 'undefined') { | ||
@@ -105,0 +109,0 @@ var events = _this.props.eventTypes; |
@@ -30,2 +30,3 @@ 'use strict'; | ||
var handlersMap = {}; | ||
var enabledInstances = {}; | ||
@@ -77,3 +78,4 @@ var touchEvents = ['touchstart', 'touchmove']; | ||
}, _this.enableOnClickOutside = function () { | ||
if (typeof document === 'undefined') return; | ||
if (typeof document === 'undefined' || enabledInstances[_this._uid]) return; | ||
enabledInstances[_this._uid] = true; | ||
@@ -119,3 +121,5 @@ var events = _this.props.eventTypes; | ||
}, _this.disableOnClickOutside = function () { | ||
delete enabledInstances[_this._uid]; | ||
var fn = handlersMap[_this._uid]; | ||
if (fn && typeof document !== 'undefined') { | ||
@@ -122,0 +126,0 @@ var events = _this.props.eventTypes; |
{ | ||
"name": "react-onclickoutside", | ||
"version": "6.6.0", | ||
"version": "6.6.1", | ||
"description": "An onClickOutside wrapper for React components", | ||
@@ -34,2 +34,4 @@ "main": "lib/index.js", | ||
"scripts": { | ||
"clean": "rimraf es lib dist", | ||
"prebuild": "npm run clean", | ||
"build": "run-p build:*", | ||
@@ -66,4 +68,4 @@ "build:es": "cross-env BABEL_ENV=es babel src -d es", | ||
"karma-chai": "^0.1.0", | ||
"karma-firefox-launcher": "^1.0.1", | ||
"karma-mocha": "^1.3.0", | ||
"karma-phantomjs-launcher": "^1.0.0", | ||
"karma-spec-reporter": "0.0.26", | ||
@@ -74,3 +76,2 @@ "karma-webpack": "^2.0.2", | ||
"npm-run-all": "^4.0.2", | ||
"phantomjs-prebuilt": "^2.1.7", | ||
"prettier": "^1.3.1", | ||
@@ -81,3 +82,3 @@ "react": "^15.5.x", | ||
"require-hijack": "^1.2.1", | ||
"rimraf": "^2.6.1", | ||
"rimraf": "^2.6.2", | ||
"rollup": "^0.50.0", | ||
@@ -84,0 +85,0 @@ "rollup-plugin-babel": "^3.0.2", |
@@ -261,4 +261,20 @@ [![npm version](https://img.shields.io/npm/v/react-onclickoutside.svg)](https://www.npmjs.com/package/react-onclickoutside) | ||
To work around the issue you can use this simple shim: | ||
```js | ||
if (!('classList' in SVGElement.prototype)) { | ||
Object.defineProperty(SVGElement.prototype, 'classList', { | ||
get() { | ||
return { | ||
contains: className => { | ||
return this.className.baseVal.split(' ').indexOf(className) !== -1 | ||
}, | ||
} | ||
}, | ||
}) | ||
} | ||
``` | ||
## I can't find what I need in the README | ||
If you've read the whole thing and you still can't find what you were looking for, then the README is missing important information that should be added in. Please [file an issue](issues) with a request for additional documentation, describing what you were hoping to find in enough detail that it can be used to write up the information you needed. |
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
29
0
280
47707
9
707