aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js
diff options
context:
space:
mode:
authorKlemen Košir <klemen.kosir@kream.io>2018-10-02 23:27:59 +0900
committerKlemen Košir <klemen.kosir@kream.io>2018-10-02 23:27:59 +0900
commit99a231a7738c712090a3ca3a088e3a1b22af5fea (patch)
tree332c335dd845d53db49a3740ed548d615445776c /ext/fg/js
parent39cf302eefe1b3bc19e4a91c222872b322426354 (diff)
Add horizontal popup offset
Diffstat (limited to 'ext/fg/js')
-rw-r--r--ext/fg/js/popup.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index a17b184a..58e0672e 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) {
@@ -64,8 +64,8 @@ class Popup {
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) {