From e888adb1c7e0181855c7cf9c2a415798ccb0b076 Mon Sep 17 00:00:00 2001 From: Denis Savosin Date: Thu, 19 Oct 2023 10:28:04 +0300 Subject: [PATCH] optimize search input --- src/mixins/HomeMixin.js | 8 ++++---- src/views/Home.vue | 19 +++++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/mixins/HomeMixin.js b/src/mixins/HomeMixin.js index 3a030055..447dd45e 100644 --- a/src/mixins/HomeMixin.js +++ b/src/mixins/HomeMixin.js @@ -135,13 +135,13 @@ const HomeMixin = { } }, /* Returns true if there is more than 1 sub-result visible during searching */ - checkIfResults() { - if (!this.sections) return false; + checkIfResults(sections) { + if (!sections) return false; else { let itemsFound = true; - this.sections.forEach((section) => { + sections.forEach((section) => { if (section.widgets && section.widgets.length > 0) itemsFound = false; - if (this.filterTiles(section.items, this.searchValue).length > 0) itemsFound = false; + if (section.filteredItems.length > 0) itemsFound = false; }); return itemsFound; } diff --git a/src/views/Home.vue b/src/views/Home.vue index a01da0f8..eba9ea99 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -27,7 +27,7 @@ + (singleSectionView ? 'single-section-view ' : '') + (this.colCount ? `col-count-${this.colCount} ` : '')" > -