From 99a231a7738c712090a3ca3a088e3a1b22af5fea Mon Sep 17 00:00:00 2001 From: Klemen Košir Date: Tue, 2 Oct 2018 23:27:59 +0900 Subject: Add horizontal popup offset --- ext/fg/js/popup.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/fg/js') 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) { -- cgit v1.2.3