Sort items for translator

In response to https://forums.zotero.org/discussion/60375?page=1#Item_6
This commit is contained in:
retorquere 2016-06-27 15:12:02 +02:00 committed by GitHub
parent caaee87e9e
commit 32c6e1edb3

View file

@ -658,6 +658,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;
},
@ -677,6 +678,7 @@ Zotero.Translate.ItemGetter.prototype = {
}
this._itemsLeft = Array.from(items.values());
this._itemsLeft.sort(function(a, b) { return a.id - b.id; });
this.numItems = this._itemsLeft.length;
},
@ -687,6 +689,7 @@ Zotero.Translate.ItemGetter.prototype = {
this._collectionsLeft = Zotero.Collections.getByLibrary(libraryID, true);
}
this._itemsLeft.sort(function(a, b) { return a.id - b.id; });
this.numItems = this._itemsLeft.length;
}),