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