Fixed finding last tab when animating

This commit is contained in:
mr. m
2025-01-30 14:09:42 +01:00
parent cd8a8b6a97
commit 5ff6d80dc8

View File

@@ -216,7 +216,12 @@ var gZenVerticalTabsManager = {
if (!gZenUIManager.motion) { if (!gZenUIManager.motion) {
return; 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 tabSize = aTab.getBoundingClientRect().height;
const transform = `-${tabSize}px`; const transform = `-${tabSize}px`;
gZenUIManager.motion gZenUIManager.motion
@@ -225,7 +230,7 @@ var gZenVerticalTabsManager = {
{ {
opacity: [0, 1], opacity: [0, 1],
transform: ['scale(0.95)', 'scale(1)'], transform: ['scale(0.95)', 'scale(1)'],
marginBottom: isLastTab ? [] : [transform, '0px'], marginBottom: isLastTab() ? [] : [transform, '0px'],
}, },
{ {
duration: 0.2, duration: 0.2,