From 675ecdc7a487af8e8539f7cef642748022fcd2b5 Mon Sep 17 00:00:00 2001 From: Aljaz Grilc Date: Thu, 23 Jan 2025 12:35:13 +0100 Subject: [PATCH] fix: Adjust popup positioning #34 --- service.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service.js b/service.js index c9328ac..6dc3d21 100644 --- a/service.js +++ b/service.js @@ -2085,7 +2085,7 @@ class BesPopup extends HTMLElement { if (x + this.offsetWidth <= window.innerWidth) { this.style.left = `${x}px` } else if (this.offsetWidth <= x) { - this.style.left = `${x - this.offsetWidth}px` + this.style.left = `${x - this.offsetWidth - 10}px` } else { this.style.left = `${(window.innerWidth - this.offsetWidth) / 2}px` } @@ -2093,7 +2093,7 @@ class BesPopup extends HTMLElement { if (y + 20 + this.offsetHeight <= window.innerHeight) { this.style.top = `${y + 20}px` } else if (this.offsetHeight <= y) { - this.style.top = `${y - this.offsetHeight}px` + this.style.top = `${y - this.offsetHeight - 20}px` } else { this.style.top = `${(window.innerHeight - this.offsetHeight) / 2}px` }