✨ Show search matches for author, description and year as well
This commit is contained in:
parent
b38054f1ba
commit
601f4976c8
|
@ -94,6 +94,7 @@ export class Filters {
|
||||||
|
|
||||||
document.querySelectorAll('.entry[data-alias]').forEach((element) => {
|
document.querySelectorAll('.entry[data-alias]').forEach((element) => {
|
||||||
const data = this.fontData[element.dataset.alias]
|
const data = this.fontData[element.dataset.alias]
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(!this.filters.style || data.style === this.filters.style) &&
|
(!this.filters.style || data.style === this.filters.style) &&
|
||||||
(!this.filters.rendering || data.rendering === this.filters.rendering) &&
|
(!this.filters.rendering || data.rendering === this.filters.rendering) &&
|
||||||
|
@ -102,7 +103,10 @@ export class Filters {
|
||||||
(data.ligatures === true && this.filters.liga === 'yes')) &&
|
(data.ligatures === true && this.filters.liga === 'yes')) &&
|
||||||
(!this.filters.zerostyle || data.zerostyle === this.filters.zerostyle) &&
|
(!this.filters.zerostyle || data.zerostyle === this.filters.zerostyle) &&
|
||||||
(this.filters.author === 'all' || data.author === this.filters.author) &&
|
(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')
|
element.classList.remove('filtered-out')
|
||||||
count++
|
count++
|
||||||
|
|
Loading…
Reference in New Issue