From 618f72b31d57ac17f475dbe983a31627cff3b96e Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Thu, 13 Feb 2025 19:04:12 +0100 Subject: frontend: Allow control-clicking to open the quick filter This makes hircine's behaviour more consistent with standard browser behaviour (that would also open a new tab when control-clicking). --- frontend/src/lib/Navigation.ts | 6 ++++- frontend/src/lib/components/Cardlet.svelte | 19 ++------------- frontend/src/lib/selection/Selectable.svelte | 36 ++++++++++++++++++++++------ frontend/src/routes/artists/+page.svelte | 9 ++++--- frontend/src/routes/characters/+page.svelte | 9 ++++--- frontend/src/routes/circles/+page.svelte | 9 ++++--- frontend/src/routes/namespaces/+page.svelte | 9 ++++--- frontend/src/routes/tags/+page.svelte | 9 ++++--- frontend/src/routes/worlds/+page.svelte | 9 ++++--- 9 files changed, 72 insertions(+), 43 deletions(-) (limited to 'frontend') diff --git a/frontend/src/lib/Navigation.ts b/frontend/src/lib/Navigation.ts index f3bc413..4dcb998 100644 --- a/frontend/src/lib/Navigation.ts +++ b/frontend/src/lib/Navigation.ts @@ -1,5 +1,5 @@ import { goto as svelteGoto } from '$app/navigation'; -import { SortDirection } from '$gql/graphql'; +import { SortDirection, type ComicFilter } from '$gql/graphql'; import JsonURL from '@jsonurl/jsonurl'; import { toastError } from './Toasts'; import type { Key } from './Utils'; @@ -120,3 +120,7 @@ export function navigate(params: NavigationParameters, current?: URLSear export function href(base: string, params: NavigationParameters) { return `/${base}/?${parametersFrom(params).toString()}`; } + +export function quickComicFilter(id: number | string, filter: keyof ComicFilter) { + window.open(href('comics', { filter: { include: { [filter]: { all: [id] } } } })); +} diff --git a/frontend/src/lib/components/Cardlet.svelte b/frontend/src/lib/components/Cardlet.svelte index d249cc8..d0c0509 100644 --- a/frontend/src/lib/components/Cardlet.svelte +++ b/frontend/src/lib/components/Cardlet.svelte @@ -1,30 +1,15 @@