From 6695717acdbac308a2bf5b13bfe29d6d35b37076 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Wed, 23 Mar 2022 18:39:15 -0700 Subject: [PATCH] Finally actually really improve contextmenu positioning. why am i so bad at this --- frontends/etiquette_flask/static/js/contextmenus.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontends/etiquette_flask/static/js/contextmenus.js b/frontends/etiquette_flask/static/js/contextmenus.js index aa881b8..3f7358d 100644 --- a/frontends/etiquette_flask/static/js/contextmenus.js +++ b/frontends/etiquette_flask/static/js/contextmenus.js @@ -35,8 +35,8 @@ function show_menu(event, menu) const html = document.documentElement; const over_right = Math.max(0, event.clientX + menu.offsetWidth - html.clientWidth); const over_bottom = Math.max(0, event.clientY + menu.offsetHeight - html.clientHeight); - const left = event.pageX - over_right; - const top = event.pageY - over_bottom; + const left = event.clientX - over_right; + const top = event.clientY - over_bottom; menu.style.left = left + "px"; menu.style.top = top + "px"; }