From 5fa1e2a552bbe6cc162c61989b398f0c00d53acf Mon Sep 17 00:00:00 2001 From: David Huynh Date: Sat, 22 May 2010 02:28:18 +0000 Subject: [PATCH] Fixed Issue 55: Use stable sorting for text facets sorted by count. git-svn-id: http://google-refine.googlecode.com/svn/trunk@841 7d457c2a-affb-35e4-300a-418c747d4874 --- CHANGES.txt | 4 ++++ src/main/webapp/scripts/facets/list-facet.js | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index cb1dcfc54..f486db0b2 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -13,6 +13,10 @@ Fixes: - Issue 45: "Renaming Cells with Ctrl-Enter produced ERROR" Tentative fix for a concurrent bug. - Issue 46: "Array literals in GEL" +- Issue 55: "Use stable sorting for text facets sorted by count" + +Features: +- Row/record sorting (Issue 32) Changes: - Moved unit tests from JUnit to TestNG diff --git a/src/main/webapp/scripts/facets/list-facet.js b/src/main/webapp/scripts/facets/list-facet.js index 5deca3066..1116d8506 100644 --- a/src/main/webapp/scripts/facets/list-facet.js +++ b/src/main/webapp/scripts/facets/list-facet.js @@ -101,7 +101,8 @@ ListFacet.prototype._reSortChoices = function() { return a.v.l.localeCompare(b.v.l); } : function(a, b) { - return b.c - a.c; + var c = b.c - a.c; + return c !== 0 ? c : a.v.l.localeCompare(b.v.l); } ); };