Only show facetOrder limited facets that have values
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 26 Sep 2010 15:53:21 +0000 (15:53 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 26 Sep 2010 15:53:21 +0000 (15:53 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@18009 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/widget/FacetSidebar.js

index 76c6684..9256ce4 100644 (file)
@@ -123,13 +123,14 @@ if(!dojo._hasResource["openils.widget.FacetSidebar"]) {
                         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(