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/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 ++++++--- 6 files changed, 36 insertions(+), 18 deletions(-) (limited to 'frontend/src/routes') diff --git a/frontend/src/routes/artists/+page.svelte b/frontend/src/routes/artists/+page.svelte index c907470..9f0d893 100644 --- a/frontend/src/routes/artists/+page.svelte +++ b/frontend/src/routes/artists/+page.svelte @@ -4,6 +4,7 @@ import type { Artist } from '$gql/graphql'; import { ArtistSortLabel } from '$lib/Enums'; import { BasicFilterContext } from '$lib/Filter.svelte'; + import { quickComicFilter } from '$lib/Navigation'; import { toastFinally } from '$lib/Toasts'; import AddButton from '$lib/components/AddButton.svelte'; import Cardlet from '$lib/components/Cardlet.svelte'; @@ -53,6 +54,8 @@ .then((artist) => modals.open(EditArtist, { artist })) .catch(toastFinally); }; + + const quickFilter = (id: number) => quickComicFilter(id, 'artists'); @@ -78,9 +81,9 @@
{#each artists.edges as { id, name }, index (id)} - - {#snippet children({ onclick, selected })} - + + {#snippet children({ onclick, onauxclick, selected })} + {#snippet overlay()} {/snippet} diff --git a/frontend/src/routes/characters/+page.svelte b/frontend/src/routes/characters/+page.svelte index 04c72cb..3a4b737 100644 --- a/frontend/src/routes/characters/+page.svelte +++ b/frontend/src/routes/characters/+page.svelte @@ -4,6 +4,7 @@ import type { Character } from '$gql/graphql'; import { CharacterSortLabel } from '$lib/Enums'; import { BasicFilterContext } from '$lib/Filter.svelte'; + import { quickComicFilter } from '$lib/Navigation'; import { toastFinally } from '$lib/Toasts'; import AddButton from '$lib/components/AddButton.svelte'; import Cardlet from '$lib/components/Cardlet.svelte'; @@ -53,6 +54,8 @@ .then((character) => modals.open(EditCharacter, { character })) .catch(toastFinally); }; + + const quickFilter = (id: number) => quickComicFilter(id, 'characters'); @@ -78,9 +81,9 @@
{#each characters.edges as { id, name }, index (id)} - - {#snippet children({ onclick, selected })} - + + {#snippet children({ onclick, onauxclick, selected })} + {#snippet overlay()} {/snippet} diff --git a/frontend/src/routes/circles/+page.svelte b/frontend/src/routes/circles/+page.svelte index 57520f8..8bac7ed 100644 --- a/frontend/src/routes/circles/+page.svelte +++ b/frontend/src/routes/circles/+page.svelte @@ -4,6 +4,7 @@ import type { Circle } from '$gql/graphql'; import { CircleSortLabel } from '$lib/Enums'; import { BasicFilterContext } from '$lib/Filter.svelte'; + import { quickComicFilter } from '$lib/Navigation'; import { toastFinally } from '$lib/Toasts'; import AddButton from '$lib/components/AddButton.svelte'; import Cardlet from '$lib/components/Cardlet.svelte'; @@ -53,6 +54,8 @@ .then((circle) => modals.open(EditCircle, { circle })) .catch(toastFinally); }; + + const quickFilter = (id: number) => quickComicFilter(id, 'circles'); @@ -78,9 +81,9 @@
{#each circles.edges as { id, name }, index (id)} - - {#snippet children({ onclick, selected })} - + + {#snippet children({ onclick, onauxclick, selected })} + {#snippet overlay()} {/snippet} diff --git a/frontend/src/routes/namespaces/+page.svelte b/frontend/src/routes/namespaces/+page.svelte index 04f7737..d8e728d 100644 --- a/frontend/src/routes/namespaces/+page.svelte +++ b/frontend/src/routes/namespaces/+page.svelte @@ -4,6 +4,7 @@ import type { Namespace } from '$gql/graphql'; import { NamespaceSortLabel } from '$lib/Enums'; import { BasicFilterContext } from '$lib/Filter.svelte'; + import { quickComicFilter } from '$lib/Navigation'; import { toastFinally } from '$lib/Toasts'; import AddButton from '$lib/components/AddButton.svelte'; import Cardlet from '$lib/components/Cardlet.svelte'; @@ -53,6 +54,8 @@ .then((namespace) => modals.open(EditNamespace, { namespace })) .catch(toastFinally); }; + + const quickFilter = (id: number) => quickComicFilter(`${id}:`, 'tags'); @@ -78,9 +81,9 @@
{#each namespaces.edges as { id, name }, index (id)} - - {#snippet children({ onclick, selected })} - + + {#snippet children({ onclick, onauxclick, selected })} + {#snippet overlay()} {/snippet} diff --git a/frontend/src/routes/tags/+page.svelte b/frontend/src/routes/tags/+page.svelte index 30554c7..f71267f 100644 --- a/frontend/src/routes/tags/+page.svelte +++ b/frontend/src/routes/tags/+page.svelte @@ -4,6 +4,7 @@ import { type Tag } from '$gql/graphql'; import { TagSortLabel } from '$lib/Enums'; import { TagFilterContext } from '$lib/Filter.svelte'; + import { quickComicFilter } from '$lib/Navigation'; import { toastFinally } from '$lib/Toasts'; import AddButton from '$lib/components/AddButton.svelte'; import Cardlet from '$lib/components/Cardlet.svelte'; @@ -58,6 +59,8 @@ .then((tag) => modals.open(EditTag, { tag })) .catch(toastFinally); }; + + const quickFilter = (id: number) => quickComicFilter(`:${id}`, 'tags'); @@ -88,9 +91,9 @@
{#each tags.edges as { id, name, description }, index (id)} - - {#snippet children({ onclick, selected })} - + + {#snippet children({ onclick, onauxclick, selected })} + {#snippet overlay()} {/snippet} diff --git a/frontend/src/routes/worlds/+page.svelte b/frontend/src/routes/worlds/+page.svelte index f223a61..6b95142 100644 --- a/frontend/src/routes/worlds/+page.svelte +++ b/frontend/src/routes/worlds/+page.svelte @@ -4,6 +4,7 @@ import type { World } from '$gql/graphql'; import { WorldSortLabel } from '$lib/Enums'; import { BasicFilterContext } from '$lib/Filter.svelte'; + import { quickComicFilter } from '$lib/Navigation'; import { toastFinally } from '$lib/Toasts'; import AddButton from '$lib/components/AddButton.svelte'; import Cardlet from '$lib/components/Cardlet.svelte'; @@ -53,6 +54,8 @@ .then((world) => modals.open(EditWorld, { world })) .catch(toastFinally); }; + + const quickFilter = (id: number) => quickComicFilter(id, 'worlds'); @@ -78,9 +81,9 @@
{#each worlds.edges as { id, name }, index (id)} - - {#snippet children({ onclick, selected })} - + + {#snippet children({ onclick, onauxclick, selected })} + {#snippet overlay()} {/snippet} -- cgit v1.2.3-2-gb3c3