Fix rightside sidebar not always staying open when overshooting mouse.

This commit is contained in:
brahim 2024-09-23 17:15:09 +02:00
parent a97e7e65ed
commit 9ac29437d8

View file

@ -219,9 +219,9 @@ var gZenCompactModeManager = {
},
_getCrossedEdge(posX, posY, element = document.documentElement, maxDistance = 10) {
posX = Math.max(0, posX);
posY = Math.max(0, posY);
const targetBox = element.getBoundingClientRect();
posX = Math.max(0, Math.min(posX, targetBox["right"]));
posY = Math.max(0, Math.min(posY, targetBox["bottom"]));
return ["top", "bottom", "left", "right"].find((edge, i) => {
const distance = Math.abs((i < 2 ? posY : posX) - targetBox[edge]);
return distance <= maxDistance;