From 601f4976c87fb225f5cc589726f8e161d95e2a15 Mon Sep 17 00:00:00 2001 From: rubjo Date: Fri, 11 Aug 2023 11:30:03 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Show=20search=20matches=20for=20aut?= =?UTF-8?q?hor,=20description=20and=20year=20as=20well?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/filters.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/filters.js b/modules/filters.js index df6ad29..bb51672 100644 --- a/modules/filters.js +++ b/modules/filters.js @@ -94,6 +94,7 @@ export class Filters { document.querySelectorAll('.entry[data-alias]').forEach((element) => { const data = this.fontData[element.dataset.alias] + if ( (!this.filters.style || data.style === this.filters.style) && (!this.filters.rendering || data.rendering === this.filters.rendering) && @@ -102,7 +103,10 @@ export class Filters { (data.ligatures === true && this.filters.liga === 'yes')) && (!this.filters.zerostyle || data.zerostyle === this.filters.zerostyle) && (this.filters.author === 'all' || data.author === this.filters.author) && - (!this.filters.name || data.name.toLowerCase().indexOf(this.filters.name) > -1) + (!this.filters.name || data.name.toLowerCase().indexOf(this.filters.name) > -1 || + data.author.toLowerCase().indexOf(this.filters.name) > -1 || + data.description?.toLowerCase().indexOf(this.filters.name) > -1 || + data.year.toString().indexOf(this.filters.name) > -1) ) { element.classList.remove('filtered-out') count++