Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. search.addWidget(
  2. instantsearch.widgets.currentRefinedValues({
  3. container: $activeFacets,
  4. clearAll: 'after',
  5. transformData: {
  6. item: function(item){
  7. if(item.attributeName =="duration_range"){
  8. switch(item.name){
  9. case "0":
  10. item.name = "0-6 minutes"
  11. break;
  12. case "1":
  13. item.name = "6-12 minutes"
  14. break;
  15. case "2":
  16. item.name = "12-18 minutes"
  17. break;
  18. case "3":
  19. item.name = "18-24 minutes"
  20. break;
  21. default:
  22. item.name = "24+ minutes"
  23. }
  24. }
  25. return item;
  26. }.bind(this)
  27. },
  28. cssClasses: {
  29. body: 'filters__active__stubs',
  30. },
  31. templates: {
  32. header: '<div class="filters__active__label">Active filters:</div>',
  33. item: '<span class="stub">' +
  34. '<span class="stub__label">{{name}}</span>' +
  35. '<a class="stub__remove" href="#" data-facet="duration_range" data-value="1">'+
  36. '<i class="fa fa-times" aria-hidden="true"></i>' +
  37. '</a>' +
  38. '</span>',
  39. clearAll: '<a class="l3 filters__clear" href="#">Clear</a>',
  40. }
  41. })
  42. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement