From 6222827593c6c27ab4a6e6351b37d567b0daea00 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Thu, 25 Aug 2022 19:43:27 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B0=D0=B4=20=D0=BF=D1=80=D0=BE=D0=B5=D0=BA=D1=82=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Search/Search.vue | 19 +++++++++++++++---- client/store/root.js | 1 + 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/client/components/Search/Search.vue b/client/components/Search/Search.vue index 56a89dd..5150bf9 100644 --- a/client/components/Search/Search.vue +++ b/client/components/Search/Search.vue @@ -107,14 +107,14 @@ {{ item.name }} -
+
{{ getBookCount(item) }}
-
+
{{ book.title }} {{ book.src.del }}
@@ -148,6 +148,7 @@ />
+
@@ -210,6 +211,9 @@ const componentOptions = { this.updatePageCount(); this.refresh(); }, + showCounts(newValue) { + this.setSetting('showCounts', newValue); + }, showDeleted(newValue) { this.setSetting('showDeleted', newValue); }, @@ -243,6 +247,7 @@ class Search { //settings expanded = []; + showCounts = true; showDeleted = false; //stuff @@ -375,6 +380,10 @@ class Search { this.scrollToTop(); } + selectTitle(title) { + this.title = `=${title}`; + } + isExpanded(item) { return this.expanded.indexOf(item.author) >= 0; } @@ -411,7 +420,7 @@ class Search { getBookCount(item) { let result = ''; - if (item.bookCount === undefined) + if (!this.showCounts || item.bookCount === undefined) return result; if (this.showDeleted) { @@ -420,8 +429,10 @@ class Search { result = item.bookCount; } - if (item.books && item.books.length < result) + if (item.books) result = `${item.books.length}/${result}`; + else + result = `#/${result}`; return `(${result})`; } diff --git a/client/store/root.js b/client/store/root.js index 8ebf55f..b7cac00 100644 --- a/client/store/root.js +++ b/client/store/root.js @@ -4,6 +4,7 @@ const state = { settings: { limit: 50, expanded: [], + showCounts: true, showDeleted: false, }, };