fix tab duplication breakage (#4286)
Fix to breakage after 3f45def
that would not open a duplicate
tab but instead create another reader instance in the same tab.
Instead of finding a tab for a specific item, use tabID that
is passed when reader should be loaded in an unloaded tab. That
allows us to know if the tab is being duplicated or not.
Fixes: #4272
This commit is contained in:
parent
4eb4741795
commit
f6b47987e9
1 changed files with 1 additions and 1 deletions
|
@ -1016,7 +1016,7 @@ class ReaderTab extends ReaderInstance {
|
|||
this._onToggleSidebarCallback = options.onToggleSidebar;
|
||||
this._onChangeSidebarWidthCallback = options.onChangeSidebarWidth;
|
||||
this._window = Services.wm.getMostRecentWindow('navigator:browser');
|
||||
let existingTabID = this._window.Zotero_Tabs.getTabIDByItemID(this._item.id);
|
||||
let existingTabID = options.tabID;
|
||||
// If an unloaded tab for this item already exists, load the reader in it.
|
||||
// Otherwise, create a new tab
|
||||
if (existingTabID) {
|
||||
|
|
Loading…
Reference in a new issue