| @@ -2898,8 +2898,16 @@ document.addEventListener("DOMContentLoaded", () => { | |||||
| document.querySelectorAll(".popout-menu").forEach(menu => menu.classList.remove("visible")); | document.querySelectorAll(".popout-menu").forEach(menu => menu.classList.remove("visible")); | ||||
| const rect = e.target.getBoundingClientRect(); | const rect = e.target.getBoundingClientRect(); | ||||
| popoutMenu.classList.add("visible"); | popoutMenu.classList.add("visible"); | ||||
| popoutMenu.style.left = rect.x + rect.width + 10 + "px"; | popoutMenu.style.left = rect.x + rect.width + 10 + "px"; | ||||
| popoutMenu.style.top = rect.y + rect.height + 10 + "px"; | popoutMenu.style.top = rect.y + rect.height + 10 + "px"; | ||||
| let menuWidth = popoutMenu.getBoundingClientRect().width; | |||||
| let screenWidth = window.innerWidth; | |||||
| if (menuWidth * 1.5 > screenWidth) { | |||||
| popoutMenu.style.left = 25 + "px"; | |||||
| } | |||||
| } | } | ||||
| e.stopPropagation(); | e.stopPropagation(); | ||||
| }); | }); | ||||
| @@ -2923,6 +2931,13 @@ document.addEventListener("DOMContentLoaded", () => { | |||||
| popoutMenu.classList.add("visible"); | popoutMenu.classList.add("visible"); | ||||
| popoutMenu.style.left = rect.x + rect.width + 10 + "px"; | popoutMenu.style.left = rect.x + rect.width + 10 + "px"; | ||||
| popoutMenu.style.top = rect.y + rect.height + 10 + "px"; | popoutMenu.style.top = rect.y + rect.height + 10 + "px"; | ||||
| let menuWidth = popoutMenu.getBoundingClientRect().width; | |||||
| let screenWidth = window.innerWidth; | |||||
| if (menuWidth * 1.5 > screenWidth) { | |||||
| popoutMenu.style.left = 25 + "px"; | |||||
| } | |||||
| } | } | ||||
| e.stopPropagation(); | e.stopPropagation(); | ||||
| }); | }); | ||||