From bd6dec352c6d769442b025146a9683464a5d58df Mon Sep 17 00:00:00 2001 From: retorquere Date: Mon, 27 Jun 2016 15:54:50 +0200 Subject: [PATCH] Sort items for translator In response to https://forums.zotero.org/discussion/60375?page=1#Item_6 --- chrome/content/zotero/xpcom/translation/translate_item.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/translation/translate_item.js b/chrome/content/zotero/xpcom/translation/translate_item.js index 5eed86e2e4..94caa8a3bb 100644 --- a/chrome/content/zotero/xpcom/translation/translate_item.js +++ b/chrome/content/zotero/xpcom/translation/translate_item.js @@ -754,6 +754,7 @@ Zotero.Translate.ItemGetter = function() { Zotero.Translate.ItemGetter.prototype = { "setItems":function(items) { this._itemsLeft = items; + this._itemsLeft.sort(function(a, b) { return a.id - b.id; }); this.numItems = this._itemsLeft.length; }, @@ -784,6 +785,7 @@ Zotero.Translate.ItemGetter.prototype = { } } + this._itemsLeft.sort(function(a, b) { return a.id - b.id; }); this.numItems = this._itemsLeft.length; }, @@ -794,6 +796,7 @@ Zotero.Translate.ItemGetter.prototype = { this._collectionsLeft = Zotero.getCollections(null, true, libraryID); } + this._itemsLeft.sort(function(a, b) { return a.id - b.id; }); this.numItems = this._itemsLeft.length; }, @@ -999,4 +1002,4 @@ Zotero.Translate.ItemGetter.prototype = { return obj; } } -Zotero.Translate.ItemGetter.prototype.__defineGetter__("numItemsRemaining", function() { return this._itemsLeft.length }); \ No newline at end of file +Zotero.Translate.ItemGetter.prototype.__defineGetter__("numItemsRemaining", function() { return this._itemsLeft.length });