Add event dispatcher
This commit is contained in:
@ -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 });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user