rc-swipeout
Advanced tools
Comparing version 1.1.4 to 1.1.5
# History | ||
## 1.1.5 | ||
- fix issue/9 | ||
## 1.1.4 | ||
@@ -4,0 +8,0 @@ |
@@ -60,3 +60,2 @@ 'use strict'; | ||
_this.openedRight = false; | ||
_this.disabledPan = false; | ||
return _this; | ||
@@ -78,18 +77,3 @@ } | ||
Swipeout.prototype.onPanStart = function onPanStart(e) { | ||
// cannot set direction by react-harmmerjs, fix left & right direction temporarily | ||
// wait react-harmmerjs pr #46 to merge | ||
var _props2 = this.props; | ||
var left = _props2.left; | ||
var right = _props2.right; | ||
var aev = e.additionalEvent; | ||
if (aev === 'panright' && !left.length) { | ||
this.disabledPan = true; | ||
} else if (aev === 'panleft' && !right.length) { | ||
this.disabledPan = true; | ||
} else { | ||
this.disabledPan = false; | ||
} | ||
if (this.props.disabled || this.disabledPan) { | ||
if (this.props.disabled) { | ||
return; | ||
@@ -101,3 +85,3 @@ } | ||
Swipeout.prototype.onPan = function onPan(e) { | ||
if (this.props.disabled || this.disabledPan) { | ||
if (this.props.disabled) { | ||
return; | ||
@@ -122,3 +106,3 @@ } | ||
Swipeout.prototype.onPanEnd = function onPanEnd(e) { | ||
if (this.props.disabled || this.disabledPan) { | ||
if (this.props.disabled) { | ||
return; | ||
@@ -151,4 +135,5 @@ } | ||
Swipeout.prototype.onTap = function onTap() { | ||
Swipeout.prototype.onTap = function onTap(e) { | ||
if (this.openedLeft || this.openedRight) { | ||
e.preventDefault(); | ||
this.close(); | ||
@@ -185,5 +170,5 @@ } | ||
Swipeout.prototype._setStyle = function _setStyle(value) { | ||
var _props3 = this.props; | ||
var left = _props3.left; | ||
var right = _props3.right; | ||
var _props2 = this.props; | ||
var left = _props2.left; | ||
var right = _props2.right; | ||
@@ -204,5 +189,4 @@ var limit = value > 0 ? this.btnsLeftWidth : -this.btnsRightWidth; | ||
Swipeout.prototype.open = function open(value, openedLeft, openedRight) { | ||
var onOpen = this.props.onOpen; | ||
if (onOpen && !this.openedLeft && !this.openedRight) { | ||
onOpen(); | ||
if (!this.openedLeft && !this.openedRight) { | ||
this.props.onOpen(); | ||
} | ||
@@ -216,5 +200,4 @@ | ||
Swipeout.prototype.close = function close() { | ||
var onClose = this.props.onClose; | ||
if (onClose && (this.openedLeft || this.openedRight)) { | ||
onClose(); | ||
if (this.openedLeft || this.openedRight) { | ||
this.props.onClose(); | ||
} | ||
@@ -221,0 +204,0 @@ this.openedLeft = false; |
{ | ||
"name": "rc-swipeout", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "swipe out ui component for react(web and react-native)", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
19823
450