mirror of
https://github.com/zotero/zotero.git
synced 2026-10-08 03:08:19 +00:00
Dramatically speed up items pane sorting (~65% reduction in sort time on a test library of 195 items)
(Moved redundant string manipulation out of the sort() callback. I put it there by mistake in r831 when namespacing all the XUL ids right before b2.r2.)
This commit is contained in:
parent
b8321f13ea
commit
aec015c039
1 changed files with 3 additions and 2 deletions
|
|
@ -513,6 +513,7 @@ Zotero.ItemTreeView.prototype.sort = function()
|
|||
column = this._treebox.columns.getFirstColumn();
|
||||
}
|
||||
var order = column.element.getAttribute('sortDirection') == 'ascending';
|
||||
var columnField = column.id.substring(13, column.id.length-7);
|
||||
|
||||
if(column.id == 'zotero-items-typeIcon-column')
|
||||
{
|
||||
|
|
@ -535,8 +536,8 @@ Zotero.ItemTreeView.prototype.sort = function()
|
|||
{
|
||||
function columnSort(a,b)
|
||||
{
|
||||
var fieldA = a.getField(column.id.substring(13, column.id.length-7));
|
||||
var fieldB = b.getField(column.id.substring(13, column.id.length-7));
|
||||
var fieldA = a.getField(columnField);
|
||||
var fieldB = b.getField(columnField);
|
||||
|
||||
if(typeof fieldA == 'string')
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue