mirror of
https://github.com/zen-browser/desktop.git
synced 2025-07-08 19:59:59 +02:00
fix(workspaces): ensure onWindowResize is triggered after workspace removal and optimize button alignment logic
This commit is contained in:
parent
5d1021350d
commit
04308fbaea
1 changed files with 12 additions and 9 deletions
|
@ -873,6 +873,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||||
await ZenWorkspacesStorage.removeWorkspace(windowID);
|
await ZenWorkspacesStorage.removeWorkspace(windowID);
|
||||||
await this._propagateWorkspaceData();
|
await this._propagateWorkspaceData();
|
||||||
await this._updateWorkspacesChangeContextMenu();
|
await this._updateWorkspacesChangeContextMenu();
|
||||||
|
this.onWindowResize();
|
||||||
}
|
}
|
||||||
|
|
||||||
isWorkspaceActive(workspace) {
|
isWorkspaceActive(workspace) {
|
||||||
|
@ -2379,6 +2380,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||||
if (!parent) {
|
if (!parent) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
window.requestAnimationFrame(() => {
|
||||||
// Once we are overflowing, we align the buttons to always stay inside the container,
|
// Once we are overflowing, we align the buttons to always stay inside the container,
|
||||||
// meaning we need to remove the overflow attribute to reset the width
|
// meaning we need to remove the overflow attribute to reset the width
|
||||||
parent.removeAttribute('overflow');
|
parent.removeAttribute('overflow');
|
||||||
|
@ -2388,5 +2390,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||||
const numButtons = parent.children.length + 1; // +1 to exclude the active button
|
const numButtons = parent.children.length + 1; // +1 to exclude the active button
|
||||||
const maxWidth = 100 / numButtons;
|
const maxWidth = 100 / numButtons;
|
||||||
parent.style.setProperty('--zen-overflowed-workspace-button-width', `${maxWidth}%`);
|
parent.style.setProperty('--zen-overflowed-workspace-button-width', `${maxWidth}%`);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue