[open-ils-commits] r18010 - branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Sun Sep 26 11:53:56 EDT 2010


Author: miker
Date: 2010-09-26 11:53:53 -0400 (Sun, 26 Sep 2010)
New Revision: 18010

Modified:
   branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/FacetSidebar.js
Log:
Backport r18009 from trunk: Only show facetOrder limited facets that have values

Modified: branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/FacetSidebar.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/FacetSidebar.js	2010-09-26 15:53:21 UTC (rev 18009)
+++ branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/FacetSidebar.js	2010-09-26 15:53:53 UTC (rev 18010)
@@ -123,13 +123,14 @@
                         var possible_facets = [];
                         if (x.facetOrder) {
                             dojo.forEach(x.facetOrder, function(fname) {
-                                possible_facets.push(dojo.filter(
+                                var maybe_facet = dojo.filter(
                                     openils.widget.Searcher._cache.arr.cmf,
                                     function (y) {
-                                        if (y.field_class == x.name && y.name == fname) return 1;
+                                        if (y.field_class == x.name && y.name == fname && facetData[y.id]) return 1;
                                         return 0;
                                     }
-                                )[0]);
+                                )[0];
+                                if (maybe_facet) possible_facets.push(maybe_facet);
                             });
                         } else {
                             possible_facets = dojo.filter(



More information about the open-ils-commits mailing list