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