Do not select the closest tab when closing a tab that is not selected
This commit is contained in:
parent
ae98488d2b
commit
8013a6ce97
1 changed files with 3 additions and 1 deletions
|
@ -153,7 +153,9 @@ var Zotero_Tabs = new function () {
|
||||||
if (!tab) {
|
if (!tab) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.select((this._tabs[tabIndex + 1] || this._tabs[tabIndex - 1]).id);
|
if (tab.id == this._selectedID) {
|
||||||
|
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) {
|
||||||
|
|
Loading…
Reference in a new issue