From 45250274695bb5452bd1195ae6bef886e9a1f07a Mon Sep 17 00:00:00 2001 From: miker Date: Sun, 26 Sep 2010 15:53:21 +0000 Subject: [PATCH] Only show facetOrder limited facets that have values 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/widget/FacetSidebar.js b/Open-ILS/web/js/dojo/openils/widget/FacetSidebar.js index 76c668462..9256ce4c7 100644 --- a/Open-ILS/web/js/dojo/openils/widget/FacetSidebar.js +++ b/Open-ILS/web/js/dojo/openils/widget/FacetSidebar.js @@ -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( -- 2.11.0