Skip to content

Commit

Permalink
Fixed finding last tab when animating
Browse files Browse the repository at this point in the history
  • Loading branch information
mauro-balades committed Jan 30, 2025
1 parent cd8a8b6 commit 5ff6d80
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/browser/base/content/ZenUIManager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,12 @@ var gZenVerticalTabsManager = {
if (!gZenUIManager.motion) {
return;
}
const isLastTab = aTab.nextElementSibling === null;
// get next visible tab
const isLastTab = () => {
const visibleTabs = gBrowser.visibleTabs;
return visibleTabs[visibleTabs.length - 1] === aTab;
};

const tabSize = aTab.getBoundingClientRect().height;
const transform = `-${tabSize}px`;
gZenUIManager.motion
Expand All @@ -225,7 +230,7 @@ var gZenVerticalTabsManager = {
{
opacity: [0, 1],
transform: ['scale(0.95)', 'scale(1)'],
marginBottom: isLastTab ? [] : [transform, '0px'],
marginBottom: isLastTab() ? [] : [transform, '0px'],
},
{
duration: 0.2,
Expand Down

0 comments on commit 5ff6d80

Please sign in to comment.