web/dialogs: move backdrop close handler to container

This commit is contained in:
wukko 2024-07-27 15:30:00 +06:00
parent b8eb708748
commit 59f5560802
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2
4 changed files with 3 additions and 9 deletions

View file

@ -2,6 +2,8 @@
import { tick } from "svelte";
import { killDialog } from "$lib/dialogs";
import DialogBackdropClose from "$components/dialog/DialogBackdropClose.svelte";
export let id: string;
let dialogParent: HTMLDialogElement;
@ -30,4 +32,5 @@
<dialog id="dialog-{id}" bind:this={dialogParent} class:closing class:open>
<slot></slot>
<DialogBackdropClose closeFunc={close} />
</dialog>

View file

@ -10,7 +10,6 @@
import PickerItem from "$components/dialog/PickerItem.svelte";
import DialogButtons from "$components/dialog/DialogButtons.svelte";
import DialogBackdropClose from "$components/dialog/DialogBackdropClose.svelte";
import IconBoxMultiple from "@tabler/icons-svelte/IconBoxMultiple.svelte";
@ -58,8 +57,6 @@
<DialogButtons {buttons} closeFunc={close} />
{/if}
</div>
<DialogBackdropClose closeFunc={close} />
</DialogContainer>
<style>

View file

@ -7,7 +7,6 @@
import Meowbalt from "$components/misc/Meowbalt.svelte";
import DialogButtons from "$components/dialog/DialogButtons.svelte";
import DialogBackdropClose from "$components/dialog/DialogBackdropClose.svelte";
import VerticalActionButton from "$components/buttons/VerticalActionButton.svelte";
import IconCopy from "@tabler/icons-svelte/IconCopy.svelte";
@ -74,8 +73,6 @@
closeFunc={close}
/>
</div>
<DialogBackdropClose closeFunc={close} />
</DialogContainer>
<style>

View file

@ -7,7 +7,6 @@
import Meowbalt from "$components/misc/Meowbalt.svelte";
import DialogButtons from "$components/dialog/DialogButtons.svelte";
import DialogBackdropClose from "$components/dialog/DialogBackdropClose.svelte";
import IconAlertTriangle from "@tabler/icons-svelte/IconAlertTriangle.svelte";
@ -53,8 +52,6 @@
<DialogButtons {buttons} closeFunc={close} />
{/if}
</div>
<DialogBackdropClose closeFunc={close} />
</DialogContainer>
<style>