mirror of
https://github.com/zen-browser/desktop.git
synced 2025-07-08 16:30:00 +02:00
fix: Fixed context menu not updating when right clicking the workspace icon, b=no-bug, c=workspaces
This commit is contained in:
parent
5cd1f77e2d
commit
ab2a982bf0
1 changed files with 7 additions and 2 deletions
|
@ -1167,7 +1167,8 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||||
} else {
|
} else {
|
||||||
openInContainerMenuItem.setAttribute('hidden', 'true');
|
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 = {
|
this.#contextMenuData = {
|
||||||
workspaceId: target?.getAttribute('zen-workspace-id'),
|
workspaceId: target?.getAttribute('zen-workspace-id'),
|
||||||
originalTarget: target,
|
originalTarget: target,
|
||||||
|
@ -1191,7 +1192,11 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||||
item.className = 'zen-workspace-context-menu-item';
|
item.className = 'zen-workspace-context-menu-item';
|
||||||
item.setAttribute('zen-workspace-id', workspace.uuid);
|
item.setAttribute('zen-workspace-id', workspace.uuid);
|
||||||
item.setAttribute('disabled', workspace.uuid === this.activeWorkspace);
|
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) => {
|
item.addEventListener('command', (e) => {
|
||||||
this.changeWorkspaceWithID(e.target.closest('menuitem').getAttribute('zen-workspace-id'));
|
this.changeWorkspaceWithID(e.target.closest('menuitem').getAttribute('zen-workspace-id'));
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue