From 285960be3293ea34a251d92ad183a1d8180bf101 Mon Sep 17 00:00:00 2001 From: Keith Solomon Date: Thu, 13 Feb 2025 15:13:16 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20Account=20for=20name=20vs?= =?UTF-8?q?=20slug=20differences?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/script.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/assets/script.js b/assets/script.js index 6c975c3..2cca681 100644 --- a/assets/script.js +++ b/assets/script.js @@ -31,11 +31,14 @@ jQuery(document).ready(function ($) { } // Resource Types - selectedTypes.forEach(function (type) { + $('input[name="resource_type[]"]:checked').each(function () { + const slug = $(this).val(); // Get the slug + const name = $(this).closest('label').text().trim(); // Get the name + appliedFilters.push( - ` - Type: ${type} - + ` + Type: ${name} + ` ); }); @@ -104,7 +107,7 @@ jQuery(document).ready(function ($) { $('#search').val(''); } else if (filterType === 'resource_type') { $('input[name="resource_type[]"]:checked').each(function () { - if ($(this).closest('label').text().trim() === filterValue) { + if ($(this).val() === filterValue) { // Match the slug, not the name $(this).prop('checked', false); } });