From b54dd68214674f06ed07c212ce877d3407c714d5 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 10 Dec 2021 18:53:35 -0700 Subject: [PATCH] fix ctx pos when window is scrollable --- scripts/contextmenu/createcontext.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/contextmenu/createcontext.js b/scripts/contextmenu/createcontext.js index a14aaf9..25883b8 100644 --- a/scripts/contextmenu/createcontext.js +++ b/scripts/contextmenu/createcontext.js @@ -3,5 +3,5 @@ module.exports = (e, target, window) => { let ctx = document.getElementById('ctx'); ctx.style.display = 'block'; ctx.style.left = `${Math.min(e.pageX, (window.innerWidth - (ctx.clientWidth + 2)))}px`; - ctx.style.top = `${Math.min(e.pageY, (window.innerHeight - (ctx.clientHeight + 2)))}px`; + ctx.style.top = `${Math.min(e.pageY, ((window.innerHeight + window.scrollY) - (ctx.clientHeight + 2)))}px`; }; \ No newline at end of file