Bug 1954962 - Fix animations for expand on hover when expanding from the left r=sidebar-reviewers,nsharpley

Differential Revision: https://phabricator.services.mozilla.com/D242386
This commit is contained in:
Kelly Cochrane
2025-03-21 01:23:34 +00:00
parent 5ab4db2864
commit 28a04d1c5f

View File

@@ -1140,7 +1140,7 @@ var SidebarController = {
? fromTranslate + widthGrowth
: fromTranslate - widthGrowth;
}
} else if (isSidebar && !this._positionStart) {
} else if (isSidebar) {
fromTranslate += sidebarOnLeft ? -widthGrowth : widthGrowth;
}
@@ -1158,12 +1158,21 @@ var SidebarController = {
}
// We want to keep the buttons in place during the animation, for which
// we might need to compensate.
if (!this._state.launcherExpanded) {
animations.push(
this.sidebarMain.animate(
[{ translate: "0" }, { translate: `${-toTranslate}px 0 0` }],
options
)
);
} else {
animations.push(
this.sidebarMain.animate(
[{ translate: `${-fromTranslate}px 0 0` }, { translate: "0" }],
options
)
);
}
}
this._ongoingAnimations = animations;
this.sidebarContainer.toggleAttribute("sidebar-ongoing-animations", true);