mirror of
https://github.com/zen-browser/desktop.git
synced 2026-03-31 21:01:55 +00:00
fix: Fixed closing last tab not closing the window and other refactors, b=closes #10455, c=common, configs, kbs, split-view, folders, tests, workspaces
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<html:div class="pinned-tabs-container-separator"></html:div>
|
||||
</vbox>
|
||||
<vbox class="zen-workspace-tabs-section zen-workspace-normal-tabs-section">
|
||||
<!-- Let it me as an ID to mantain compatibility with firefox's tabbrowser -->
|
||||
<!-- Let it as an ID to mantain compatibility with firefox's tabbrowser -->
|
||||
<hbox id="tabbrowser-arrowscrollbox-periphery">
|
||||
<toolbartabstop/>
|
||||
<toolbarbutton id="tabs-newtab-button"
|
||||
|
||||
@@ -1130,7 +1130,7 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
|
||||
}
|
||||
}
|
||||
|
||||
handleTabBeforeClose(tab, closeWindowWithLastTab = false) {
|
||||
handleTabBeforeClose(tab, closeWindowWithLastTab) {
|
||||
if (!this.workspaceEnabled || this.__contextIsDelete || this._removedByStartupPage) {
|
||||
return null;
|
||||
}
|
||||
@@ -1144,7 +1144,8 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
|
||||
let tabsPinned = tabs.filter(
|
||||
(t) => !this.shouldOpenNewTabIfLastUnpinnedTabIsClosed || !t.pinned
|
||||
);
|
||||
const shouldCloseWindow = this.shouldCloseWindow() && closeWindowWithLastTab;
|
||||
const shouldCloseWindow =
|
||||
closeWindowWithLastTab != null ? closeWindowWithLastTab : this.shouldCloseWindow();
|
||||
if (tabs.length === 1 && tabs[0] === tab) {
|
||||
if (shouldCloseWindow) {
|
||||
// We've already called beforeunload on all the relevant tabs if we get here,
|
||||
|
||||
Reference in New Issue
Block a user