Jump back to the opening tab even if the PDF was already open

Fixes #1985
This commit is contained in:
Martynas Bagdonas 2021-08-30 14:56:09 +03:00
parent 295874f803
commit b5ea925d02
2 changed files with 4 additions and 3 deletions

View file

@ -288,13 +288,14 @@ var Zotero_Tabs = new function () {
* Select a tab
*
* @param {String} id
* @param {Boolean} reopening
*/
this.select = function (id) {
this.select = function (id, reopening) {
var { tab } = this._getTab(id);
if (!tab || tab.id === this._selectedID) {
return;
}
this._prevSelectedID = null;
this._prevSelectedID = reopening ? this._selectedID : null;
this._selectedID = id;
this.deck.selectedIndex = Array.from(this.deck.children).findIndex(x => x.id == id);
this._update();

View file

@ -996,7 +996,7 @@ class Reader {
if (reader) {
if (reader instanceof ReaderTab) {
reader._window.Zotero_Tabs.select(reader.tabID);
reader._window.Zotero_Tabs.select(reader.tabID, true);
}
if (location) {