Do not select the closest tab when closing a tab that is not selected

This commit is contained in:
Martynas Bagdonas 2021-03-17 11:33:18 +02:00
parent ae98488d2b
commit 8013a6ce97

View file

@ -153,7 +153,9 @@ var Zotero_Tabs = new function () {
if (!tab) { if (!tab) {
return; return;
} }
if (tab.id == this._selectedID) {
this.select((this._tabs[tabIndex + 1] || this._tabs[tabIndex - 1]).id); this.select((this._tabs[tabIndex + 1] || this._tabs[tabIndex - 1]).id);
}
this._tabs.splice(tabIndex, 1); this._tabs.splice(tabIndex, 1);
document.getElementById(tab.id).remove(); document.getElementById(tab.id).remove();
if (tab.onClose) { if (tab.onClose) {