From 0a7ee3fcf0048c00b4e1e639b3c28a96b18a5f2f Mon Sep 17 00:00:00 2001 From: Guilherme Luiz Cella <151692400+guilherme-luiz-cella@users.noreply.github.com> Date: Tue, 12 May 2026 06:57:56 -0300 Subject: [PATCH] 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> --- src/zen/split-view/ZenViewSplitter.mjs | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/zen/split-view/ZenViewSplitter.mjs b/src/zen/split-view/ZenViewSplitter.mjs index 783f2646d..2dc68c03c 100644 --- a/src/zen/split-view/ZenViewSplitter.mjs +++ b/src/zen/split-view/ZenViewSplitter.mjs @@ -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) {