mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-03 16:36:35 +00:00
Fixed finding last tab when animating
This commit is contained in:
@@ -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
|
||||
@@ -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,
|
||||
|
Reference in New Issue
Block a user