mirror of
https://github.com/zen-browser/desktop.git
synced 2026-01-07 05:43:21 +00:00
fix: Fixed context menu not updating when right clicking the workspace icon, b=no-bug, c=workspaces
This commit is contained in:
@@ -1167,7 +1167,8 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
} else {
|
||||
openInContainerMenuItem.setAttribute('hidden', 'true');
|
||||
}
|
||||
const target = event.explicitOriginalTarget?.closest('toolbarbutton');
|
||||
// Call parent node as on windows, the text can be double clicked
|
||||
const target = event.explicitOriginalTarget?.parentNode?.closest('toolbarbutton');
|
||||
this.#contextMenuData = {
|
||||
workspaceId: target?.getAttribute('zen-workspace-id'),
|
||||
originalTarget: target,
|
||||
@@ -1191,7 +1192,11 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
item.className = 'zen-workspace-context-menu-item';
|
||||
item.setAttribute('zen-workspace-id', workspace.uuid);
|
||||
item.setAttribute('disabled', workspace.uuid === this.activeWorkspace);
|
||||
item.setAttribute('label', (workspace.icon ?? ' \u25CB ') + ' ' + workspace.name);
|
||||
let name = workspace.name;
|
||||
if (workspace.icon && workspace.icon !== '') {
|
||||
name = `${workspace.icon} ${name}`;
|
||||
}
|
||||
item.setAttribute('label', name);
|
||||
item.addEventListener('command', (e) => {
|
||||
this.changeWorkspaceWithID(e.target.closest('menuitem').getAttribute('zen-workspace-id'));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user