mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
feat: Improved tab switching for containerizedd essentials, b=(no-bug), c=common, workspaces
This commit is contained in:
@@ -70,9 +70,12 @@ var gZenUIManager = {
|
||||
} catch (error) {
|
||||
console.error('Error updating layout breakout:', error);
|
||||
}
|
||||
setTimeout(() => {
|
||||
ZenWorkspaces.updateTabsContainers();
|
||||
}, 0);
|
||||
if (!this._preventToolbarRebuild) {
|
||||
setTimeout(() => {
|
||||
ZenWorkspaces.updateTabsContainers();
|
||||
}, 0);
|
||||
}
|
||||
delete this._preventToolbarRebuild;
|
||||
},
|
||||
|
||||
get tabsWrapper() {
|
||||
|
@@ -1973,7 +1973,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
const newTransform = `translateX(${offset}%)`;
|
||||
if (shouldAnimate) {
|
||||
if (element.classList.contains('zen-workspace-pinned-tabs-section') && this.containerSpecificEssentials) {
|
||||
await this.updateTabsContainers(element, true);
|
||||
// Note: Do not call with await on purpose, for better timing on animations
|
||||
this.updateTabsContainers(element, true);
|
||||
}
|
||||
element.removeAttribute('hidden');
|
||||
animations.push(
|
||||
@@ -2102,6 +2103,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
}
|
||||
}
|
||||
if (shouldAnimate) {
|
||||
gZenUIManager._preventToolbarRebuild = true;
|
||||
gZenUIManager.updateTabsToolbar();
|
||||
}
|
||||
await Promise.all(animations);
|
||||
@@ -2296,7 +2298,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
}
|
||||
|
||||
async updateTabsContainers(target = undefined, forAnimation = false) {
|
||||
if (target && !(target instanceof HTMLElement)) {
|
||||
if (target && !target.parentNode) {
|
||||
target = null;
|
||||
}
|
||||
await this.onPinnedTabsResize([{ target: target ?? this.pinnedTabsContainer }], forAnimation);
|
||||
|
Reference in New Issue
Block a user