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
parent fa32eb6790
commit 6ca854a018
2 changed files with 3 additions and 3 deletions

View file

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

View file

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