mirror of
https://github.com/zen-browser/desktop.git
synced 2026-05-20 12:01:27 +00:00
no-bug: Refactor _oppositeSide method using OPPOSITE_SIDES (gh-13613)
Signed-off-by: Guilherme Luiz Cella <151692400+guilherme-luiz-cella@users.noreply.github.com> Co-authored-by: mr. m <91018726+mr-cheffy@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
c406e79c5d
commit
0a7ee3fcf0
@@ -969,19 +969,14 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature {
|
||||
};
|
||||
|
||||
_oppositeSide(side) {
|
||||
if (side === "top") {
|
||||
return "bottom";
|
||||
}
|
||||
if (side === "bottom") {
|
||||
return "top";
|
||||
}
|
||||
if (side === "left") {
|
||||
return "right";
|
||||
}
|
||||
if (side === "right") {
|
||||
return "left";
|
||||
}
|
||||
return undefined;
|
||||
const OPPOSITE_SIDES = {
|
||||
top: "bottom",
|
||||
bottom: "top",
|
||||
left: "right",
|
||||
right: "left",
|
||||
};
|
||||
|
||||
return OPPOSITE_SIDES[side];
|
||||
}
|
||||
|
||||
calculateHoverSide(x, y, elementRect) {
|
||||
|
||||
Reference in New Issue
Block a user