[open-ils-commits] r18026 - branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Sep 27 11:31:53 EDT 2010
Author: miker
Date: 2010-09-27 11:31:50 -0400 (Mon, 27 Sep 2010)
New Revision: 18026
Modified:
branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/FacetSidebar.js
Log:
Backport r18025 from trunk: Provide for limiting the number of classOrder elements to a specific number. Skips those without facet 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-27 15:23:10 UTC (rev 18025)
+++ branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/FacetSidebar.js 2010-09-27 15:31:50 UTC (rev 18026)
@@ -66,6 +66,7 @@
facetCacheKey : '',
searchBox : '',
classOrder : null, // Array of cmc.name values, OR array of objects with name and facetOrder properties
+ displayItemLimit : 999, // Number of distinctly described entries (classes or facets), that have values, to display from classOrder
searchSubmit : '',
facetLimit : 10,
maxValuesPerFacet : 100,
@@ -116,6 +117,7 @@
);
}
+ var displayedItems = 0;
var me = this;
dojo.forEach(
classes,
@@ -126,7 +128,12 @@
var maybe_facet = dojo.filter(
openils.widget.Searcher._cache.arr.cmf,
function (y) {
- if (y.field_class == x.name && y.name == fname && facetData[y.id]) return 1;
+ if (y.field_class == x.name && y.name == fname && facetData[y.id]) {
+ if (displayedItems < me.displayItemLimit) {
+ displayedItems++;
+ return 1;
+ }
+ }
return 0;
}
)[0];
@@ -136,7 +143,12 @@
possible_facets = dojo.filter(
openils.widget.Searcher._cache.arr.cmf,
function (y) {
- if (y.field_class == x.name && facetData[y.id]) return 1;
+ if (y.field_class == x.name && facetData[y.id]) {
+ if (displayedItems < me.displayItemLimit) {
+ displayedItems++;
+ return 1;
+ }
+ }
return 0;
}
);
More information about the open-ils-commits
mailing list