Jump back to the opening tab even if the PDF was already open
Fixes #1985
This commit is contained in:
parent
295874f803
commit
b5ea925d02
2 changed files with 4 additions and 3 deletions
|
@ -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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue