rc-drawer
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -429,3 +429,2 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
getOpenCount = _this$props7.getOpenCount, | ||
getContainer = _this$props7.getContainer, | ||
open = _this$props7.open; | ||
@@ -432,0 +431,0 @@ delete currentDrawer[this.drawerId]; |
@@ -70,20 +70,9 @@ export function dataToArray(vars) { | ||
var scrollX = currentTarget.scrollWidth - currentTarget.clientWidth; | ||
/** | ||
* <div style="height: 300px"> | ||
* <div style="height: 900px"></div> | ||
* </div> | ||
* 在没设定 overflow: auto 或 scroll 时,currentTarget 里获取不到 scrollTop 或 scrollLeft, | ||
* 预先用 scrollTo 来滚动,如果取出的值跟滚动前取出不同,则 currnetTarget 被设定了 overflow; 否则就是上面这种。 | ||
*/ | ||
var style = document.defaultView.getComputedStyle(currentTarget); | ||
var overflowY = style.overflowY === 'auto' || style.overflowY === 'scroll'; | ||
var overflowX = style.overflowX === 'auto' || style.overflowX === 'scroll'; | ||
var y = scrollY && overflowY; | ||
var x = scrollX && overflowX; | ||
var t = currentTarget.scrollTop; | ||
var l = currentTarget.scrollLeft; | ||
currentTarget.scrollTop += 1; | ||
currentTarget.scrollLeft += 1; | ||
var currentT = currentTarget.scrollTop; | ||
var currentL = currentTarget.scrollLeft; | ||
currentTarget.scrollTop -= 1; | ||
currentTarget.scrollLeft -= 1; | ||
if (isY && (!scrollY || !(currentT - t) || scrollY && (currentTarget.scrollTop >= scrollY && differY < 0 || currentTarget.scrollTop <= 0 && differY > 0)) || isX && (!scrollX || !(currentL - l) || scrollX && (currentTarget.scrollLeft >= scrollX && differX < 0 || currentTarget.scrollLeft <= 0 && differX > 0))) { | ||
if (isY && (!y || y && (currentTarget.scrollTop >= scrollY && differY < 0 || currentTarget.scrollTop <= 0 && differY > 0)) || isX && (!x || x && (currentTarget.scrollLeft >= scrollX && scrollX < 0 || currentTarget.scrollLeft <= 0 && scrollX > 0))) { | ||
return getTouchParentScroll(root, currentTarget.parentNode, differX, differY); | ||
@@ -90,0 +79,0 @@ } |
@@ -447,3 +447,2 @@ "use strict"; | ||
getOpenCount = _this$props7.getOpenCount, | ||
getContainer = _this$props7.getContainer, | ||
open = _this$props7.open; | ||
@@ -450,0 +449,0 @@ delete currentDrawer[this.drawerId]; |
@@ -92,20 +92,9 @@ "use strict"; | ||
var scrollX = currentTarget.scrollWidth - currentTarget.clientWidth; | ||
/** | ||
* <div style="height: 300px"> | ||
* <div style="height: 900px"></div> | ||
* </div> | ||
* 在没设定 overflow: auto 或 scroll 时,currentTarget 里获取不到 scrollTop 或 scrollLeft, | ||
* 预先用 scrollTo 来滚动,如果取出的值跟滚动前取出不同,则 currnetTarget 被设定了 overflow; 否则就是上面这种。 | ||
*/ | ||
var style = document.defaultView.getComputedStyle(currentTarget); | ||
var overflowY = style.overflowY === 'auto' || style.overflowY === 'scroll'; | ||
var overflowX = style.overflowX === 'auto' || style.overflowX === 'scroll'; | ||
var y = scrollY && overflowY; | ||
var x = scrollX && overflowX; | ||
var t = currentTarget.scrollTop; | ||
var l = currentTarget.scrollLeft; | ||
currentTarget.scrollTop += 1; | ||
currentTarget.scrollLeft += 1; | ||
var currentT = currentTarget.scrollTop; | ||
var currentL = currentTarget.scrollLeft; | ||
currentTarget.scrollTop -= 1; | ||
currentTarget.scrollLeft -= 1; | ||
if (isY && (!scrollY || !(currentT - t) || scrollY && (currentTarget.scrollTop >= scrollY && differY < 0 || currentTarget.scrollTop <= 0 && differY > 0)) || isX && (!scrollX || !(currentL - l) || scrollX && (currentTarget.scrollLeft >= scrollX && differX < 0 || currentTarget.scrollLeft <= 0 && differX > 0))) { | ||
if (isY && (!y || y && (currentTarget.scrollTop >= scrollY && differY < 0 || currentTarget.scrollTop <= 0 && differY > 0)) || isX && (!x || x && (currentTarget.scrollLeft >= scrollX && scrollX < 0 || currentTarget.scrollLeft <= 0 && scrollX > 0))) { | ||
return getTouchParentScroll(root, currentTarget.parentNode, differX, differY); | ||
@@ -112,0 +101,0 @@ } |
{ | ||
"name": "rc-drawer", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "drawer component for react", | ||
@@ -35,3 +35,3 @@ "keywords": [ | ||
"scripts": { | ||
"start": "father doc dev --storybook", | ||
"start": "rm -rf .storybook lib es && father doc dev --storybook", | ||
"build": "father doc build --storybook", | ||
@@ -64,3 +64,2 @@ "compile": "father build && lessc assets/index.less assets/index.css", | ||
"querystring": "^0.2.0", | ||
"rc-dialog": "7.4.1", | ||
"rc-test": "^6.0.1", | ||
@@ -67,0 +66,0 @@ "react": "^16.0.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
21
89479
1939