From 131fab103206cae3fb42fe9a4fcf598d166f668d Mon Sep 17 00:00:00 2001 From: Marie Date: Fri, 1 Nov 2024 13:08:28 +0000 Subject: [PATCH 1/2] upd: add clear filter option if filter is set --- packages/frontend/src/widgets/WidgetSearch.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/widgets/WidgetSearch.vue b/packages/frontend/src/widgets/WidgetSearch.vue index 9a0752c7f9..8899741821 100644 --- a/packages/frontend/src/widgets/WidgetSearch.vue +++ b/packages/frontend/src/widgets/WidgetSearch.vue @@ -93,7 +93,14 @@ function options(ev) { filetype.value = 'video'; }, }], - }], ev.currentTarget ?? ev.target); + }, + ...(filetype.value ? [{ + text: 'Clear Filter', + icon: 'ti ti-trash', + action: () => { + filetype.value = null; + }, + }] : [])], ev.currentTarget ?? ev.target); } async function search() { From c8357a410bbd1fee4cae2225d8a56b1c4393aad8 Mon Sep 17 00:00:00 2001 From: Marie Date: Fri, 1 Nov 2024 17:45:04 +0000 Subject: [PATCH 2/2] =?UTF-8?q?upd:=20append=20=E2=9C=94=20on=20set=20filt?= =?UTF-8?q?er?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/widgets/WidgetSearch.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/frontend/src/widgets/WidgetSearch.vue b/packages/frontend/src/widgets/WidgetSearch.vue index 8899741821..1a328be7ce 100644 --- a/packages/frontend/src/widgets/WidgetSearch.vue +++ b/packages/frontend/src/widgets/WidgetSearch.vue @@ -72,7 +72,7 @@ function options(ev) { { type: 'button', icon: 'ph-image ph-bold ph-lg', - text: 'With Images', + text: `With Images ${filetype.value === 'image' ? '✔' : ''}`, action: () => { filetype.value = 'image'; }, @@ -80,7 +80,7 @@ function options(ev) { { type: 'button', icon: 'ph-music-notes-simple ph-bold ph-lg', - text: 'With Audios', + text: `With Audios ${filetype.value === 'audio' ? '✔' : ''}`, action: () => { filetype.value = 'audio'; }, @@ -88,7 +88,7 @@ function options(ev) { { type: 'button', icon: 'ph-video ph-bold ph-lg', - text: 'With Videos', + text: `With Videos ${filetype.value === 'video' ? '✔' : ''}`, action: () => { filetype.value = 'video'; },