stylable-components
Advanced tools
Comparing version 0.5.9 to 0.5.10
@@ -120,4 +120,3 @@ "use strict"; | ||
]; | ||
var scrollX = window.pageXOffset || document.documentElement.scrollLeft; | ||
var scrollY = window.pageYOffset || document.documentElement.scrollTop; | ||
var _a = utils_1.getScroll(), scrollX = _a.scrollX, scrollY = _a.scrollY; | ||
var winWidth = window.innerWidth; | ||
@@ -160,4 +159,18 @@ var winHeight = window.innerHeight; | ||
offsetWidth; | ||
newStyle.top = getVerticalReference(anchorRect, props.anchorPosition.vertical); | ||
newStyle.left = getHorizontalReference(anchorRect, props.anchorPosition.horizontal); | ||
var _d = utils_1.getScroll(), scrollX_1 = _d.scrollX, scrollY_1 = _d.scrollY; | ||
var _e = props.anchorPosition, vertical = _e.vertical, horizontal = _e.horizontal; | ||
newStyle.left = scrollX_1; | ||
newStyle.top = scrollY_1; | ||
if (vertical === 'center') { | ||
newStyle.top += anchorRect.top + (anchorRect.height / 2); | ||
} | ||
else { | ||
newStyle.top += anchorRect[vertical]; | ||
} | ||
if (horizontal === 'center') { | ||
newStyle.left += anchorRect.left + (anchorRect.width / 2); | ||
} | ||
else { | ||
newStyle.left += anchorRect[horizontal]; | ||
} | ||
} | ||
@@ -196,18 +209,2 @@ switch (props.popupPosition.vertical) { | ||
exports.Popup = Popup; | ||
function getVerticalReference(rect, anchorPosition) { | ||
if (anchorPosition === 'center') { | ||
return window.pageYOffset + rect.top + (rect.height / 2); | ||
} | ||
else { | ||
return window.pageYOffset + rect[anchorPosition]; | ||
} | ||
} | ||
function getHorizontalReference(rect, anchorPosition) { | ||
if (anchorPosition === 'center') { | ||
return window.pageXOffset + rect.left + (rect.width / 2); | ||
} | ||
else { | ||
return window.pageXOffset + rect[anchorPosition]; | ||
} | ||
} | ||
function isPoint(elem) { | ||
@@ -214,0 +211,0 @@ return elem.hasOwnProperty('x') && elem.hasOwnProperty('y'); |
@@ -185,4 +185,3 @@ "use strict"; | ||
var rect = this.target.getBoundingClientRect(); | ||
var scrollY = window.pageYOffset || document.documentElement.scrollTop; | ||
var scrollX = window.pageXOffset || document.documentElement.scrollLeft; | ||
var _a = utils_1.getScroll(), scrollX = _a.scrollX, scrollY = _a.scrollY; | ||
var rectTop = rect.top + scrollY; | ||
@@ -189,0 +188,0 @@ var rectLeft = rect.left + scrollX; |
@@ -15,1 +15,2 @@ export * from './clamp'; | ||
export * from './is-rtl-context'; | ||
export * from './get-scroll'; |
@@ -20,2 +20,3 @@ "use strict"; | ||
__export(require("./is-rtl-context")); | ||
__export(require("./get-scroll")); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "stylable-components", | ||
"version": "0.5.9", | ||
"version": "0.5.10", | ||
"description": "Fully-tested & strictly-typed component library based on React, using optional Wix styling.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/src/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 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
1127126
517
14186