www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit eea7bc4a7552b6c8191af0a0365b31cff16e3f59
parent ebd7d5a155f736d2442fc9f5182bc43bd20ec86b
Author: Simon Kornblith <simon@simonster.com>
Date:   Sun, 28 Aug 2011 17:56:23 +0000

Fix incorrect sorting of newly added items (off by one)


Diffstat:
Mchrome/content/zotero/xpcom/itemTreeView.js | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js @@ -1017,13 +1017,13 @@ Zotero.ItemTreeView.prototype.sort = function(itemID) var includeTrashed = this._itemGroup.isTrash(); - var i = 0, me = this; + var rowsSorted = 0, me = this; function rowSort(a, b) { - if(i === 1000) { + if(rowsSorted === 1000) { me.showLoadingMessageIfNecessary(); - i = 0; + rowsSorted = 0; } - i++; + rowsSorted++; var cmp, fieldA, fieldB; @@ -1306,7 +1306,7 @@ Zotero.ItemTreeView.prototype.sort = function(itemID) if (itemID) { var row = this._itemRowMap[itemID]; for (var i=0, len=this._dataItems.length; i<len; i++) { - if (i == row) { + if (i === row) { continue; }