react-sheet
Advanced tools
Comparing version 0.0.26 to 0.0.27
@@ -28,2 +28,3 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
window.addEventListener('keypress', _this.onKeyPress, false); | ||
document.addEventListener('click', _this.onOutsideClick); | ||
}; | ||
@@ -43,2 +44,9 @@ | ||
_this.removeAllListeners = function () { | ||
window.removeEventListener('keydown', _this.onKeyDown, false); | ||
window.removeEventListener('keydown', _this.onEscapeKeyDown, false); | ||
window.removeEventListener('keypress', _this.onKeyPress, false); | ||
document.removeEventListener('click', _this.onOutsideClick); | ||
}; | ||
_this.onKeyPress = function (e) { | ||
@@ -229,16 +237,8 @@ if (!_this.isFocused()) { | ||
_this.hideOnClickOutside = function (element) { | ||
var outsideClickListener = function outsideClickListener(event) { | ||
if (!element.contains(event.target)) { | ||
if (_this.isVisible(element)) { | ||
_this.removeListeners(); | ||
} | ||
_this.onOutsideClick = function (event) { | ||
if (!_this.keyWrapper.contains(event.target)) { | ||
if (_this.isVisible(_this.keyWrapper)) { | ||
_this.removeAllListeners(); | ||
} | ||
}; | ||
var removeClickListener = function removeClickListener() { | ||
document.removeEventListener('click', outsideClickListener); | ||
}; | ||
document.addEventListener('click', outsideClickListener); | ||
} | ||
}; | ||
@@ -261,3 +261,2 @@ | ||
this.addListeners(); | ||
this.hideOnClickOutside(this.keyWrapper); | ||
}; | ||
@@ -264,0 +263,0 @@ |
@@ -43,2 +43,3 @@ 'use strict'; | ||
window.addEventListener('keypress', _this.onKeyPress, false); | ||
document.addEventListener('click', _this.onOutsideClick); | ||
}; | ||
@@ -58,2 +59,9 @@ | ||
_this.removeAllListeners = function () { | ||
window.removeEventListener('keydown', _this.onKeyDown, false); | ||
window.removeEventListener('keydown', _this.onEscapeKeyDown, false); | ||
window.removeEventListener('keypress', _this.onKeyPress, false); | ||
document.removeEventListener('click', _this.onOutsideClick); | ||
}; | ||
_this.onKeyPress = function (e) { | ||
@@ -244,16 +252,8 @@ if (!_this.isFocused()) { | ||
_this.hideOnClickOutside = function (element) { | ||
var outsideClickListener = function outsideClickListener(event) { | ||
if (!element.contains(event.target)) { | ||
if (_this.isVisible(element)) { | ||
_this.removeListeners(); | ||
} | ||
_this.onOutsideClick = function (event) { | ||
if (!_this.keyWrapper.contains(event.target)) { | ||
if (_this.isVisible(_this.keyWrapper)) { | ||
_this.removeAllListeners(); | ||
} | ||
}; | ||
var removeClickListener = function removeClickListener() { | ||
document.removeEventListener('click', outsideClickListener); | ||
}; | ||
document.addEventListener('click', outsideClickListener); | ||
} | ||
}; | ||
@@ -276,3 +276,2 @@ | ||
this.addListeners(); | ||
this.hideOnClickOutside(this.keyWrapper); | ||
}; | ||
@@ -279,0 +278,0 @@ |
{ | ||
"name": "react-sheet", | ||
"version": "0.0.26", | ||
"version": "0.0.27", | ||
"description": "Spreadsheet component for react", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
3176330
38251