Skip to content
Snippets Groups Projects
Commit 3f08741e authored by Bryan Sharpe's avatar Bryan Sharpe Committed by Jimmy Henderickx
Browse files

Issue #2910421 by gauravjeet, b_sharpe: If same facet is used more than once...

Issue #2910421 by gauravjeet, b_sharpe: If same facet is used more than once on a page - soft limit does not work correctly
parent cb9f66dc
No related branches found
No related tags found
No related merge requests found
......@@ -33,8 +33,18 @@
var zero_based_limit = (limit - 1);
var facetsList = $('ul[data-drupal-facet-id="' + facet + '"]');
// In case of multiple instances of a facet, we need to key them.
if (facetsList.length > 1) {
facetsList.each(function (key, $value) {
var $facet_id = $(this).attr('data-drupal-facet-id');
$(this).attr('data-drupal-facet-id', $facet_id + '-' + key);
});
}
// Hide facets over the limit.
facetsList.children('li:gt(' + zero_based_limit + ')').once().hide();
facetsList.each(function() {
$(this).children('li:gt(' + zero_based_limit + ')').once().hide();
});
// Add "Show more" / "Show less" links.
facetsList.once().filter(function () {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment