mirror of
https://github.com/zotero/zotero.git
synced 2026-09-29 01:41:24 +00:00
Take object instead of id in Utilities.Internal.showInLibrary()
Not updating quickFormat.js, since we'll be removing that
This commit is contained in:
parent
6d52656a92
commit
764dd1a9da
3 changed files with 15 additions and 5 deletions
|
|
@ -71,7 +71,7 @@ export class CitationDialogPopupsHandler {
|
|||
this._getNode("#itemDetails .show").addEventListener("click", (_) => {
|
||||
this.discardItemDetailsEdits = true;
|
||||
this._getNode("#itemDetails").hidePopup();
|
||||
Zotero.Utilities.Internal.showInLibrary(this.item.id);
|
||||
Zotero.Utilities.Internal.showInLibrary(this.item);
|
||||
});
|
||||
this._getNode("#itemDetails .done").addEventListener("click", (_) => {
|
||||
this._getNode("#itemDetails").hidePopup();
|
||||
|
|
@ -232,7 +232,7 @@ export class CitationDialogPopupsHandler {
|
|||
}
|
||||
// Show in library
|
||||
if (result == 2) {
|
||||
Zotero.Utilities.Internal.showInLibrary(item.id);
|
||||
Zotero.Utilities.Internal.showInLibrary(item);
|
||||
return false;
|
||||
}
|
||||
// Checked "Do not warn about this item"
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@ window.ZoteroDocumentCitations = {
|
|||
this.onItemRelink();
|
||||
}
|
||||
else {
|
||||
await Zotero.Utilities.Internal.showInLibrary(item.id);
|
||||
await Zotero.Utilities.Internal.showInLibrary(item);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -1737,7 +1737,12 @@ Zotero.Utilities.Internal = {
|
|||
},
|
||||
|
||||
|
||||
showInLibrary: async function (itemID) {
|
||||
/**
|
||||
* Select an object in the library tab of the main window
|
||||
*
|
||||
* @param {Zotero.DataObject} - Data object (e.g., Zotero.Item) to select
|
||||
*/
|
||||
showInLibrary: async function (dataObject) {
|
||||
var pane = Zotero.getActiveZoteroPane();
|
||||
// Open main window if it's not open (Mac)
|
||||
if (!pane) {
|
||||
|
|
@ -1751,7 +1756,12 @@ Zotero.Utilities.Internal = {
|
|||
});
|
||||
pane = win.ZoteroPane;
|
||||
}
|
||||
pane.selectItem(itemID);
|
||||
if (dataObject instanceof Zotero.Item) {
|
||||
pane.selectItem(dataObject.id);
|
||||
}
|
||||
else {
|
||||
throw new Error("Unimplemented");
|
||||
}
|
||||
|
||||
// Pull window to foreground
|
||||
Zotero.Utilities.Internal.activate(pane.document.defaultView);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue