Refactor ZenWorkspaces.mjs to add createContainerTabMenu method

This commit is contained in:
mauro-balades 2024-09-13 20:12:05 +02:00
parent 89f28b307d
commit 4cedd84ac8

View file

@ -683,6 +683,20 @@ var ZenWorkspaces = {
}, },
// Tab browser utilities // Tab browser utilities
createContainerTabMenu(event) {
let window = event.target.ownerGlobal;
const workspace = this.getActiveWorkspaceFromCache();
if (!workspace) {
return;
}
let containerTabId = workspace.containerTabId;
return window.createUserContextMenu(event, {
isContextMenu: true,
excludeUserContextId: containerTabId,
showDefaultTab: true,
});
},
getContextIdIfNeeded(userContextId) { getContextIdIfNeeded(userContextId) {
if (typeof userContextId !== "undefined" || !this.workspaceEnabled) { if (typeof userContextId !== "undefined" || !this.workspaceEnabled) {
return [userContextId, false]; return [userContextId, false];