Merge pull request #506 from jepler/flexible-text-search

downloads search: Enable text search on id, manufacturer, and features
This commit is contained in:
Scott Shawcroft 2020-07-20 15:46:34 -07:00 committed by GitHub
commit 3b4877a439
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -326,9 +326,9 @@ function shouldDisplayDownload(download, displayedManufacturers, displayedFeatur
if (downloadsSearch.searchTerm && downloadsSearch.searchTerm.length > 0 && shouldDisplay) {
var regex = new RegExp(downloadsSearch.searchTerm, "gi");
var name = download.dataset.name;
var haystack = download.dataset.name + " " + download.dataset.id + " " + download.dataset.manufacturer + " " + download.dataset.features;
shouldDisplay = name.match(regex);
shouldDisplay = haystack.match(regex);
}
return shouldDisplay;