mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-07 02:16:36 +00:00
Add error handling to tab animation and refine empty tab selection logic
This commit is contained in:
@@ -347,33 +347,37 @@ var gZenVerticalTabsManager = {
|
|||||||
return visibleTabs[visibleTabs.length - 1] === aTab;
|
return visibleTabs[visibleTabs.length - 1] === aTab;
|
||||||
};
|
};
|
||||||
|
|
||||||
const tabSize = aTab.getBoundingClientRect().height;
|
try {
|
||||||
const transform = `-${tabSize}px`;
|
const tabSize = aTab.getBoundingClientRect().height;
|
||||||
gZenUIManager.motion
|
const transform = `-${tabSize}px`;
|
||||||
.animate(
|
gZenUIManager.motion
|
||||||
aTab,
|
.animate(
|
||||||
{
|
aTab,
|
||||||
opacity: [0, 1],
|
{
|
||||||
transform: ['scale(0.95)', 'scale(1)'],
|
opacity: [0, 1],
|
||||||
marginBottom: isLastTab() ? [] : [transform, '0px'],
|
transform: ['scale(0.95)', 'scale(1)'],
|
||||||
},
|
marginBottom: isLastTab() ? [] : [transform, '0px'],
|
||||||
{
|
},
|
||||||
duration: 0.2,
|
{
|
||||||
easing: 'ease-out',
|
duration: 0.2,
|
||||||
}
|
easing: 'ease-out',
|
||||||
)
|
}
|
||||||
.then(() => {
|
)
|
||||||
aTab.style.removeProperty('margin-bottom');
|
.then(() => {
|
||||||
aTab.style.removeProperty('transform');
|
aTab.style.removeProperty('margin-bottom');
|
||||||
aTab.style.removeProperty('opacity');
|
aTab.style.removeProperty('transform');
|
||||||
});
|
aTab.style.removeProperty('opacity');
|
||||||
gZenUIManager.motion
|
});
|
||||||
.animate(aTab.querySelector('.tab-content'), {
|
gZenUIManager.motion
|
||||||
filter: ['blur(1px)', 'blur(0px)'],
|
.animate(aTab.querySelector('.tab-content'), {
|
||||||
})
|
filter: ['blur(1px)', 'blur(0px)'],
|
||||||
.then(() => {
|
})
|
||||||
aTab.querySelector('.tab-stack').style.removeProperty('filter');
|
.then(() => {
|
||||||
});
|
aTab.querySelector('.tab-stack').style.removeProperty('filter');
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
get actualWindowButtons() {
|
get actualWindowButtons() {
|
||||||
|
@@ -628,7 +628,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
(currentTab.isEmpty &&
|
(currentTab.isEmpty &&
|
||||||
(currentTab.getAttribute('image') === gPageIcons[currentTabURL] || !currentTab.hasAttribute('image'))) ||
|
(currentTab.getAttribute('image') === gPageIcons[currentTabURL] || !currentTab.hasAttribute('image'))) ||
|
||||||
currentTab.hasAttribute('zen-empty-tab') ||
|
currentTab.hasAttribute('zen-empty-tab') ||
|
||||||
currentTab._possibleEmptyTab
|
(currentTab._possibleEmptyTab && currentTab.isEmpty)
|
||||||
) {
|
) {
|
||||||
this.selectEmptyTab();
|
this.selectEmptyTab();
|
||||||
this._removedByStartupPage = true;
|
this._removedByStartupPage = true;
|
||||||
|
Reference in New Issue
Block a user