From a8162e673ef47509debd6573deebd28c9121d030 Mon Sep 17 00:00:00 2001 From: lubber-de Date: Fri, 19 Mar 2021 00:53:22 +0100 Subject: [PATCH 1/2] fix(popup): correct positioning for parent margins --- src/definitions/modules/popup.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/definitions/modules/popup.js b/src/definitions/modules/popup.js index d6b70e14a6..6c349d7186 100644 --- a/src/definitions/modules/popup.js +++ b/src/definitions/modules/popup.js @@ -820,7 +820,12 @@ $.fn.popup = function(parameters) { if(searchDepth == settings.maxSearchDepth && typeof settings.lastResort === 'string') { position = settings.lastResort; } - + if(position === 'top right' || position === 'bottom right') { + var possibleMargin = calculations.boundary.right - calculations.parent.width; + if(possibleMargin > 0) { + offset -= possibleMargin; + } + } switch (position) { case 'top left': positioning = { From 94270ba965c4eccb6c1a0ef97e7b5c16438225c4 Mon Sep 17 00:00:00 2001 From: lubber-de Date: Sun, 19 Mar 2023 17:18:27 +0100 Subject: [PATCH 2/2] feat(popup): linting fixes --- src/definitions/modules/popup.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/definitions/modules/popup.js b/src/definitions/modules/popup.js index 73d6dba47b..2fe17ceb7c 100644 --- a/src/definitions/modules/popup.js +++ b/src/definitions/modules/popup.js @@ -818,12 +818,12 @@ if (searchDepth === settings.maxSearchDepth && typeof settings.lastResort === 'string') { position = settings.lastResort; } - if(position === 'top right' || position === 'bottom right') { - var possibleMargin = calculations.boundary.right - calculations.parent.width; - if(possibleMargin > 0) { - offset -= possibleMargin; - } - } + if (position === 'top right' || position === 'bottom right') { + var possibleMargin = calculations.boundary.right - calculations.parent.width; + if (possibleMargin > 0) { + offset -= possibleMargin; + } + } switch (position) { case 'top left': { positioning = {