Fix navigation to annotation when opening an unloaded PDF reader tab

Regression from 142e3b09
This commit is contained in:
Martynas Bagdonas 2022-08-18 10:19:07 +03:00 committed by Dan Stillman
parent 8ca7356489
commit 40ae2e3246
2 changed files with 3 additions and 3 deletions

View file

@ -337,7 +337,7 @@ var Zotero_Tabs = new function () {
* @param {String} id * @param {String} id
* @param {Boolean} reopening * @param {Boolean} reopening
*/ */
this.select = function (id, reopening) { this.select = function (id, reopening, options) {
var { tab, tabIndex } = this._getTab(id); var { tab, tabIndex } = this._getTab(id);
if (!tab || tab.id === this._selectedID) { if (!tab || tab.id === this._selectedID) {
return; return;
@ -348,7 +348,7 @@ var Zotero_Tabs = new function () {
} }
if (tab.type === 'reader-unloaded') { if (tab.type === 'reader-unloaded') {
this.close(tab.id); this.close(tab.id);
Zotero.Reader.open(tab.data.itemID, null, { Zotero.Reader.open(tab.data.itemID, options && options.location, {
tabID: tab.id, tabID: tab.id,
title: tab.title, title: tab.title,
tabIndex, tabIndex,

View file

@ -1383,7 +1383,7 @@ class Reader {
if (win) { if (win) {
let existingTabID = win.Zotero_Tabs.getTabIDByItemID(itemID); let existingTabID = win.Zotero_Tabs.getTabIDByItemID(itemID);
if (existingTabID) { if (existingTabID) {
win.Zotero_Tabs.select(existingTabID); win.Zotero_Tabs.select(existingTabID, false, { location });
return; return;
} }
} }