1$(function () { 2 3$('button.product-filter').on('click', function () { 4 5 resetButtons(); 6 $(this).addClass('btn-info').removeClass('btn-outline-info') 7 8 if ($(this).data('type') === 'cat') { 9 10 let categoryFilter = $(this).data('category'); 11 12 $('div.product-cards').each(function () { 13 $(this).hide(); 14 if ( $(this).data('category').split(',').includes(categoryFilter)) $(this).show(); 15 }); 16 17 } else if ($(this).data('type') === 'ff') { 18 19 let freeFromFilter = $(this).data('category'); 20 21 $('div.product-cards').each(function () { 22 $(this).hide(); 23 if ( $(this).data('tags').split(',').includes(freeFromFilter)) $(this).show(); 24 }); 25 } 26}); 27 28$('button#reset').on('click', function () { 29 resetButtons(); 30 $('div.product-cards').each(function () { 31 $(this).show(); 32 }); 33 return true; 34}); 35 36function resetButtons () { 37 $('button.product-filter').each(function () { 38 if ($(this).hasClass('btn-info')) { 39 $(this).removeClass('btn-info').addClass('btn-outline-info'); 40 } 41 }); 42} 43 44});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.