mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
Refactor welcome page transitions and reorganize tabs after welcome screen
This commit is contained in:
@@ -167,6 +167,9 @@
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
margin: 8rem auto auto 13.4rem;
|
||||
@media (-moz-platform: macos) {
|
||||
margin: 4rem auto auto 10.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
#zen-welcome-initial-essentials-browser {
|
||||
|
@@ -177,7 +177,14 @@
|
||||
async next() {
|
||||
if (this._currentPage !== -1) {
|
||||
const previousPage = this._pages[this._currentPage];
|
||||
await Promise.all([this.fadeOutTitles(), this.fadeOutButtons(), this.fadeOutContent()]);
|
||||
const promises = [
|
||||
this.fadeOutTitles(),
|
||||
this.fadeOutButtons(),
|
||||
];
|
||||
if (!previousPage.dontFadeOut) {
|
||||
promises.push(this.fadeOutContent());
|
||||
}
|
||||
await Promise.all(promises);
|
||||
await previousPage.fadeOut();
|
||||
document.getElementById('zen-welcome-page-content').innerHTML = '';
|
||||
}
|
||||
@@ -193,6 +200,7 @@
|
||||
}
|
||||
|
||||
async finish() {
|
||||
ZenWorkspaces.reorganizeTabsAfterWelcome();
|
||||
await animate('#zen-welcome-page-content', { x: [0, '100%'] }, { bounce: 0 });
|
||||
document.getElementById('zen-welcome-page-content').remove();
|
||||
await this.animHeart();
|
||||
@@ -319,6 +327,7 @@
|
||||
position: 'top',
|
||||
});
|
||||
},
|
||||
dontFadeOut: true,
|
||||
async fadeOut() {
|
||||
gZenThemePicker.panel.removeAttribute('noautohide');
|
||||
gZenThemePicker.panel.removeAttribute('consumeoutsideclicks');
|
||||
|
@@ -2229,4 +2229,12 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
(tab) => tab.hasAttribute('zen-essential') || tab.getAttribute('zen-workspace-id') === currentWorkspace
|
||||
);
|
||||
}
|
||||
|
||||
reorganizeTabsAfterWelcome() {
|
||||
const children = gBrowser.tabContainer.arrowScrollbox.children;
|
||||
const remainingTabs = Array.from(children).filter((child) => child.tagName === 'tab');
|
||||
for (const tab of remainingTabs) {
|
||||
this.moveTabToWorkspace(tab, this.activeWorkspace);
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
Reference in New Issue
Block a user