Skip to content

Commit

Permalink
Add facet count to combo box dropdowns
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangmm committed Oct 23, 2023
1 parent f3694e5 commit 048ec99
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions resources/scripts/browse.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ document.addEventListener('DOMContentLoaded', function () {
facets.submit();
});
});

ev.detail.querySelectorAll('pb-combo-box').forEach((select) => {
select.renderFunction = (data, escape) => {
if (data) {
return `<div>${escape(data.text)} <span class="freq">${escape(data.freq || '')}</span></div>`;
}
return '';
}
});
});

// if there's a combo box, synchronize any changes to it with existing checkboxes
Expand Down

0 comments on commit 048ec99

Please sign in to comment.