diff --git a/src/_includes/icons/filter.html b/src/_includes/icons/filter.html
index 689f063ea..54253f953 100644
--- a/src/_includes/icons/filter.html
+++ b/src/_includes/icons/filter.html
@@ -15,7 +15,7 @@
{% for icon in icons %}
{% endfor %}
diff --git a/src/assets/js/site.js b/src/assets/js/site.js
index 3e5cf4756..a84c52d8c 100644
--- a/src/assets/js/site.js
+++ b/src/assets/js/site.js
@@ -32,12 +32,12 @@ $(function() {
var resultsCount = 0;
$icons.each(function() {
- var filter = $(this).attr('data-filter')
- var show = filter.match(' '+val);
+ var filter = $(this).attr('data-filter').split('|');
+ var show = inFilter(val, filter);
if (!show) {
if (val.slice(-1) === 's') {
// Try to be smart. Make plural terms singular.
- show = filter.match(' '+val.slice(0, -1));
+ show = inFilter(val.slice(0, -1), filter);
}
}
if (show) resultsCount++;
@@ -53,6 +53,17 @@ $(function() {
}).trigger('keyup');
}
+ function inFilter(val, filter) {
+ var found = false;
+ for (var i = 0; i < filter.length; i++) {
+ if (filter[i].match(val)) {
+ found = true;
+ break;
+ }
+ }
+ return found;
+ }
+