From e16c9c95a2c03d93c8ae5e0ca67b83ad913b0cb6 Mon Sep 17 00:00:00 2001 From: Aditya Date: Thu, 24 Oct 2024 18:59:19 +0530 Subject: [PATCH 1/2] Fix popup display downward Signed-off-by: Aditya --- js/popup.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/popup.js b/js/popup.js index ab9d01fab..54c0ea0d7 100644 --- a/js/popup.js +++ b/js/popup.js @@ -95,9 +95,15 @@ enyo.kind({ // Popup will overflow window, prepare to shift menu this.overflowY = true; } + var screenHeight = document.getElementById("canvas").offsetHeight; + var popupTopPosition = mouse.position.y + this.margin.top; + var popupBottomPosition = mouse.position.x + this.margin.left; + if (mouse.position.y + popupSize > screenHeight) { + popupTopPosition -= (popupSize + 10); + } this.setStyle("bottom", ""); - this.applyStyle("top", (mouse.position.y+this.margin.top)+"px"); - this.applyStyle("left", (mouse.position.x+this.margin.left)+"px"); + this.applyStyle("top", (popupTopPosition) + "px"); + this.applyStyle("left", (popupBottomPosition) + "px"); this.show(); this.timer = window.setInterval(enyo.bind(this, "showContent"), 0); }, From 5f770849edd8781aca45ea2831c9866b60bb99c9 Mon Sep 17 00:00:00 2001 From: Aditya Date: Tue, 29 Oct 2024 13:07:24 +0530 Subject: [PATCH 2/2] Fix: Popup display downward increase the page length Signed-off-by: Aditya --- js/popup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/popup.js b/js/popup.js index 54c0ea0d7..d6913aa44 100644 --- a/js/popup.js +++ b/js/popup.js @@ -99,7 +99,7 @@ enyo.kind({ var popupTopPosition = mouse.position.y + this.margin.top; var popupBottomPosition = mouse.position.x + this.margin.left; if (mouse.position.y + popupSize > screenHeight) { - popupTopPosition -= (popupSize + 10); + popupTopPosition = screenHeight+this.margin.top-popupSize; } this.setStyle("bottom", ""); this.applyStyle("top", (popupTopPosition) + "px");