commit ed6d628f4e1af57578f4f42b47f886a996d8ca36 parent 01ecff8e2b248f446e35c1c20f15bfcbf8fac610 Author: Dan Stillman <dstillman@zotero.org> Date: Fri, 1 Sep 2017 13:21:18 -0400 Fix Create Bib for saved searches Diffstat:
| M | chrome/content/zotero/fileInterface.js | | | 30 | +++++++++++------------------- |
1 file changed, 11 insertions(+), 19 deletions(-)
diff --git a/chrome/content/zotero/fileInterface.js b/chrome/content/zotero/fileInterface.js @@ -126,7 +126,6 @@ var Zotero_File_Interface = new function() { this.exportCollection = exportCollection; this.exportItemsToClipboard = exportItemsToClipboard; this.exportItems = exportItems; - this.bibliographyFromCollection = bibliographyFromCollection; this.bibliographyFromItems = bibliographyFromItems; /** @@ -392,33 +391,26 @@ var Zotero_File_Interface = new function() { progressWin.startCloseTimer(5000); }); - /* + /** * Creates a bibliography from a collection or saved search */ - function bibliographyFromCollection() { - // find sorted items - var items = Zotero.Items.get(ZoteroPane_Local.getSortedItems(true)); - if(!items) return; + this.bibliographyFromCollection = function () { + var items = ZoteroPane.getSortedItems(); - // find name + // Find collection name var name = false; - - var collection = ZoteroPane_Local.getSelectedCollection(); - if(collection) { - name = collection.getName(); - } else { - var searchRef = ZoteroPane_Local.getSelectedSavedSearch(); - if(searchRef) { - var search = new Zotero.Search(); - search.id = searchRef.id; + var collection = ZoteroPane.getSelectedCollection(); + if (collection) { + name = collection.name; + } + else { + let search = ZoteroPane.getSelectedSavedSearch(); + if (search) { name = search.name; } } _doBibliographyOptions(name, items); - return; - - throw ("No collection or saved search currently selected"); } /*