diff options
author | Alex Yatskov <FooSoft@users.noreply.github.com> | 2019-05-19 17:43:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-19 17:43:31 -0700 |
commit | 84b990cd804185c24629de0ce9694aa3dbc03c29 (patch) | |
tree | 6915bb4df3a7b1838c1f06aee8c0e94931edfd4c /ext/fg/js | |
parent | 61d1168d94a7467be6e98afc375d7583c0f23cb5 (diff) | |
parent | 99a231a7738c712090a3ca3a088e3a1b22af5fea (diff) |
Merge pull request #140 from KarboniteKream/horizontal-offset
Add horizontal popup offset
Diffstat (limited to 'ext/fg/js')
-rw-r--r-- | ext/fg/js/popup.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js index 14276efe..d2acf4d0 100644 --- a/ext/fg/js/popup.js +++ b/ext/fg/js/popup.js @@ -50,7 +50,7 @@ class Popup { const limitX = document.body.clientWidth; const limitY = window.innerHeight; - let x = elementRect.left; + let x = elementRect.left + options.general.popupHorizontalOffset; let width = Math.max(containerWidth, options.general.popupWidth); const overflowX = Math.max(x + width - limitX, 0); if (overflowX > 0) { @@ -65,8 +65,8 @@ class Popup { let above = false; let y = 0; let height = Math.max(containerHeight, options.general.popupHeight); - const yBelow = elementRect.bottom + options.general.popupOffset; - const yAbove = elementRect.top - options.general.popupOffset; + const yBelow = elementRect.bottom + options.general.popupVerticalOffset; + const yAbove = elementRect.top - options.general.popupVerticalOffset; const overflowBelow = Math.max(yBelow + height - limitY, 0); const overflowAbove = Math.max(height - yAbove, 0); if (overflowBelow > 0 || overflowAbove > 0) { |