This commit is contained in:
mr. m
2025-04-04 13:00:30 +02:00
4 changed files with 17 additions and 8 deletions

View File

@@ -25,7 +25,7 @@
<command id="cmd_zenWorkspaceSwitch10" />
<command id="cmd_zenOpenZenThemePicker" />
<command id="cmd_zenChangeWorkspaceTabColor" />
<command id="cmd_zenChangeWorkspaceTab" />
<command id="cmd_zenToggleTabsOnRight" />
<command id="cmd_zenReplacePinnedUrlWithCurrent" />

View File

@@ -53,7 +53,7 @@ document.addEventListener(
gZenThemePicker.openThemePicker(event);
break;
case 'cmd_zenChangeWorkspaceTab':
ZenWorkspaces.changeTabWorkspace(event.target.getAttribute('zen-workspace-id'));
ZenWorkspaces.changeTabWorkspace(event.sourceEvent.target.getAttribute('zen-workspace-id'));
break;
case 'cmd_zenToggleTabsOnRight':
gZenVerticalTabsManager.toggleTabsOnRight();

View File

@@ -234,14 +234,23 @@
});
}
closeGlance({ noAnimation = false, onTabClose = false, setNewID = null, isDifferent = false, hasFocused = false } = {}) {
closeGlance({
noAnimation = false,
onTabClose = false,
setNewID = null,
isDifferent = false,
hasFocused = false,
skipPermitUnload = false,
} = {}) {
if (this._animating || !this.#currentBrowser || this.animatingOpen || this._duringOpening) {
return;
}
let { permitUnload } = this.#currentBrowser.permitUnload();
if (!permitUnload) {
return;
if (!skipPermitUnload) {
let { permitUnload } = this.#currentBrowser.permitUnload();
if (!permitUnload) {
return;
}
}
if (onTabClose && hasFocused && !this.#confirmationTimeout) {
@@ -545,7 +554,7 @@
this.overlay.classList.remove('zen-glance-overlay');
this._clearContainerStyles(this.browserWrapper);
this.animatingFullOpen = false;
this.closeGlance({ noAnimation: true });
this.closeGlance({ noAnimation: true, skipPermitUnload: true });
this.#glances.delete(this.#currentGlanceID);
}

View File

@@ -1898,6 +1898,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
const menuItem = document.createXULElement('menuitem');
menuItem.setAttribute('label', workspace.name);
menuItem.setAttribute('zen-workspace-id', workspace.uuid);
menuItem.setAttribute('command', 'cmd_zenChangeWorkspaceTab');
if (workspace.uuid === activeWorkspace.uuid) {
menuItem.setAttribute('disabled', 'true');
@@ -2208,7 +2209,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
const menuPopup = document.createXULElement('menupopup');
menuPopup.setAttribute('id', 'context-zen-change-workspace-tab-menu-popup');
menuPopup.setAttribute('command', 'cmd_zenChangeWorkspaceTab');
menu.appendChild(menuPopup);