mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 01:39:59 +02:00
Fix rightside sidebar not always staying open when overshooting mouse.
This commit is contained in:
parent
a97e7e65ed
commit
9ac29437d8
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue