c92b5b790779371b350dbee33d0d7383d3bd6f91 chmalee Thu Nov 2 10:58:21 2023 -0700 Fix mouseover pop up positioning when the pop up would normally be off the top of the window, refs #32011 diff --git src/hg/js/utils.js src/hg/js/utils.js index 97c6f2c..660f173 100644 --- src/hg/js/utils.js +++ src/hg/js/utils.js @@ -3885,31 +3885,31 @@ // first case, refEl takes the whole width of the image, so not a big deal to cover some of it // this is most common for the track labels if (mouseX + popUpRect.width >= (windowWidth - 25)) { // move to the left leftOffset = mouseX - popUpRect.width; } // or the mouse is on the right third of the screen if (mouseX > (windowWidth* 0.66)) { // move to the left leftOffset = mouseX - popUpRect.width; } // the page is scrolled or otherwise off the screen if (topOffset <= 0) { - topOffset = mouseY - window.scrollY + popUpRect.height; + topOffset = mouseY - window.scrollY; } if (leftOffset < 0) { throw new Error("trying to position off of screen to left"); } popUpEl.style.left = leftOffset + "px"; popUpEl.style.top = topOffset + "px"; } // the current mouseover timer, for showing the mouseover after a delay var mouseoverTimer; // the timer for when a user is moving the mouse after already bringing up // a pop up, there may be many items close together and we want the user // to bring up those mouseovers var mousemoveTimer;