diff --git a/chrome/content/zotero/integration/quickFormat.js b/chrome/content/zotero/integration/quickFormat.js index 9c2e0e2706..b7d53d6f92 100644 --- a/chrome/content/zotero/integration/quickFormat.js +++ b/chrome/content/zotero/integration/quickFormat.js @@ -265,19 +265,38 @@ var Zotero_QuickFormat = new function () { while(referenceBox.hasChildNodes()) referenceBox.removeChild(referenceBox.firstChild); + var firstSelectableIndex = 0; + if(ids.length) { if(ids.length > 50) ids = ids.slice(0, 50); var items = Zotero.Items.get(ids); + + firstSelectableIndex = 1; + + //TODO: sort the currently used items in before any other items + items.sort(function(a, b) {return a.libraryID > b.libraryID}) + + var previousLibrary = -1; + for(var i=0, n=items.length; i