From 52c8bac7958f691b6ed3b14f0177225df8f39ee4 Mon Sep 17 00:00:00 2001 From: Avris Date: Sun, 8 Aug 2021 19:29:31 +0200 Subject: [PATCH] [terms] link flags to terms - now also using keys --- components/Flag.vue | 3 +++ src/classes.js | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/components/Flag.vue b/components/Flag.vue index 0a3a7542..d6cc10e6 100644 --- a/components/Flag.vue +++ b/components/Flag.vue @@ -34,6 +34,9 @@ } for (let term of this.terms || []) { + if (term.key.toLowerCase().includes(this.alt.toLowerCase())) { + return term.key; + } if (term.term.toLowerCase().includes(this.name.toLowerCase())) { return this.name; } diff --git a/src/classes.js b/src/classes.js index 1952e1fd..f4e479f7 100644 --- a/src/classes.js +++ b/src/classes.js @@ -745,6 +745,10 @@ export class TermsEntry { return this.categories.includes(filter.substring(1)); } + if (this.key && this.key.toLowerCase().indexOf(filter.toLowerCase()) > -1) { + return true; + } + for (let field of ['term', 'original']) { for (let value of this[field]) { if (value.toLowerCase().indexOf(filter.toLowerCase()) > -1) {