Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- search.addWidget(
- instantsearch.widgets.currentRefinedValues({
- container: $activeFacets,
- clearAll: 'after',
- transformData: {
- item: function(item){
- if(item.attributeName =="duration_range"){
- switch(item.name){
- case "0":
- item.name = "0-6 minutes"
- break;
- case "1":
- item.name = "6-12 minutes"
- break;
- case "2":
- item.name = "12-18 minutes"
- break;
- case "3":
- item.name = "18-24 minutes"
- break;
- default:
- item.name = "24+ minutes"
- }
- }
- return item;
- }.bind(this)
- },
- cssClasses: {
- body: 'filters__active__stubs',
- },
- templates: {
- header: '<div class="filters__active__label">Active filters:</div>',
- item: '<span class="stub">' +
- '<span class="stub__label">{{name}}</span>' +
- '<a class="stub__remove" href="#" data-facet="duration_range" data-value="1">'+
- '<i class="fa fa-times" aria-hidden="true"></i>' +
- '</a>' +
- '</span>',
- clearAll: '<a class="l3 filters__clear" href="#">Clear</a>',
- }
- })
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement