Add event dispatcher

This commit is contained in:
Luca Bosin
2023-08-28 08:42:51 +02:00
parent 15a93fbba7
commit 61dbc00a98

View File

@ -1,8 +1,11 @@
<script lang="ts">
import { createEventDispatcher } from 'svelte';
import { str, strf } from "$lib/data/language";
import { getFileName } from "$lib/util/links";
import Icon from "./Icon.svelte";
const dispatch = createEventDispatcher();
/** The base url of the image. */
export let base: string;
@ -20,6 +23,9 @@
console.log('click', event);
if (!event.shiftKey && !event.ctrlKey) {
event.preventDefault();
dispatch('lightbox', { album, item });
} else {
dispatch('open', { album, item });
}
}